Set an agent's knowledge
Replace the intelligence documents an agent reads, each inlined, retrieved or left to the runtime. Every document must belong to the workspace.
PUT
https://app.trygtm.com/api/v1/agents/{preset}/knowledge- Scope
write- MCP tool
- set_agent_knowledge
Path parameters
presetstringrequired- The agent's role, from list_agents: leads, intent, outreach, copy or qa. Pass this or agentId.
leadsintentoutreachcopyqa
Headers
Idempotency-Keystringoptional- A key unique to this write, up to 255 characters. A retry carrying the same key returns the first response instead of running again. Kept for 24 hours.
Body
agent_idstringoptional- The agent's id, from list_agents. Pass this or preset.
documentsobject[]required- Every document the agent should read, up to 64.
document_idstringrequired- An intelligence document's id.
usagestringoptionaldefault: auto- How the agent reads it.
autoragfull_context
Request
curl -X PUT https://app.trygtm.com/api/v1/agents/copy/knowledge \
-H "Authorization: Bearer $TRYGTM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"documents": []
}'Response
{
"data": {
"id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"preset": "copy",
"name": "GTM Copy",
"version": 7,
"detail": "The agent reads 2 documents."
}
}