Setting up a full flow
A typical end-to-end setup using these tools:
- Pick the org — if you belong to several, call
list_orgsand passorg=<slug>to each tool (single-org accounts can omit it). - (Optional) build reusable blocks first so the agent can reference them:
create_code_tool(name, source_code)for a custom Python tool.create_prompt(name, text)— passfieldstoo for a prompt that returns structured data instead of free text (seeprompt-fields) — /create_skill(name, instructions, tool_slugs).
- Create the agent —
create_agent(name, instruction=..., provider=..., model=..., allowed_tools=[...]).allowed_toolsaccepts tool scope strings or slugs. - Wire / adjust it —
update_agent(agent, instruction=..., allowed_tools=..., mounted_skills=[...]). Partial: only the fields you pass change. - Test before deploying — try the draft without making it live:
start_chat(agent, message, use_draft=true)runs the chat on the unpublished draft instruction. Pollget_chatas usual.- Building blocks in isolation:
test_code_tool(tool, args),test_prompt(prompt, variables)(ortest_prompt(prompt, input_text=...)for a schema-bearing prompt) — no chat needed. See thetestingdoc.
- Deploy —
deploy_agent(agent)to make the draft instruction active. (Skills/code tools/prompts don’t need a deploy step.) - Run it —
start_chat(agent, message)→ returns achat_id. - Read the result — poll
get_chat(chat_id)untilstatus!= “running”; read the final assistant message +outcomes. If it’s “paused” with apending_hitl_request, answer viarespond_to_hitl.
Use list_* / get_* tools at any point to inspect existing entities.