Skip to main content

Agents

Functions for creating, reading, updating, running, and wiring up agents. Edits create a new draft version; the user confirms deploy in chat before changes go live.

Linking distinguishes workspace tools (org-owned tool_…, made with tool-create) from integrations (catalog connectors such as Outlook, Jira, Slack). Use agent-link-tool / agent-link-integration accordingly — never mix them.


agent-create

Create an agent with explicit fields. shortDescription is the card/summary text; systemPrompt holds the full behavior instructions. Placement uses the scoped folder when set, otherwise org root.

Input

FieldTypeRequiredDescription
namestringYesShort snake_case identifier (letters, digits, underscores; spaces become _).
shortDescriptionstringYesBrief summary for listings.
systemPromptstringYesFull system / task instructions.
agentGuidelinesstringNoOptional extra guidelines.
conversationStartersarrayNoUp to 2 starters, each \{ name, prompt \}.

Output

FieldTypeDescription
agentIdstringId of the new agent (agt_…).
versionIdstringId of the created version.

agent-ask-create

Show multiple-choice follow-up questions in chat before calling agent-create — for example to confirm scope or options once integrations are connected. This presents questions; it does not create anything.

Input

FieldTypeRequiredDescription
introstringYesShort friendly line (e.g. confirming a connection worked).
questionsarrayYes1–5 questions, each \{ id, prompt, options: [\{ id, label \}], allowCustom? \}.

Output

FieldTypeDescription
presentedbooleantrue when the questions were shown.
introstringThe intro echoed back.
questionsarrayThe questions echoed back for rendering.

agent-read

Read one agent: core metadata, the current editable version, systemPrompt, agentGuidelines, conversation starters, linked tools / integrations / tables / workflows / knowledge bases, and schedules.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id (agt_…).

Output

FieldTypeDescription
agentobjectFull payload: metadata, current version (id, description, systemPrompt, agentGuidelines, timestamps, deployed flag), conversationStarters[], linkedTools[], integrations[], linkedTables[], linkedWorkflows[], linkedKnowledgeBases[], schedules[].

agent-update

Update an existing agent (same fields as agent-create). Only include fields that should change; at least one is required. Commits a new draft version that the user must deploy.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
namestringNoNew snake_case name.
shortDescriptionstringNoNew summary.
systemPromptstringNoNew system prompt.
agentGuidelinesstringNoNew guidelines.
conversationStartersarrayNoWhen set, replaces all starters (max 2).

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe committed draft version id.

agent-run

Execute an agent with a text input. The org, user, session, and call ids are set automatically. Requires the execution backend to be configured.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
inputstringYesTask or message for the agent.

Output

FieldTypeDescription
agentIdstringThe resolved agent id.
versionIdstringVersion used for the run.
sessionIdstringDerived run session id.
agentCallIdstringDerived call id.
resultobjectRaw response payload from the execution backend.

Attach workspace tools (llm_tool / template_tool / code_tool, ids tool_…) to an agent. Use names in refs or ids in toolIds. If a tool needs an integration that isn't configured, the call returns requiresIntegrationConfig.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
refsstring[]NoTool names (not ids), e.g. ["join-orgs"].
toolIdsstring[]NoTool ids, e.g. ["tool_…"].

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe draft version the tools were added to.
linkedToolsarrayLinked tools with toolId, toolName, toolType, integrationName.

Remove a workspace tool (tool_…) from an agent.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
refstringYesTool id or name to remove.

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe draft version.

Attach integrations (catalog connectors — OAuth/configured services) to an agent. Use integration ids or catalog names/refs. Returns requiresIntegrationConfig with missingIntegrations if any are not yet configured.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
refsstring[]YesIntegration ids or names (at least one).

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe draft version the integrations were added to.

Remove an integration (catalog connector) from an agent.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
refstringYesIntegration id or name to remove.

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe draft version.

Combined linker. Set relationType to tool or integration. Prefer the dedicated agent-link-tool / agent-link-integration functions when possible; this exists for convenience and legacy input shapes. relationType: schedule is not supported here (use the schedule functions).

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
relationTypeenumYes*tool or integration (inferred from toolIds/integrationIds if omitted).
refsstring[]NoNames/ids depending on relationType.
toolIdsstring[]NoTool ids (implies tool).
integrationIdsstring[]NoIntegration ids (implies integration).

Output — same as the corresponding dedicated link function (linkedTools[] for tools; agentId + versionId for integrations).


Combined unlinker. Set relationType to tool or integration; pass ref (or legacy toolId/integrationId). Mirrors agent-link.

Input

FieldTypeRequiredDescription
agentIdstringYesAgent id.
relationTypeenumYes*tool or integration (inferred from toolId/integrationId).
refstringYesThe tool/integration id or name to remove.

Output

FieldTypeDescription
agentIdstringThe agent id.
versionIdstringThe draft version.