Skip to content

Setting up a full flow

A typical end-to-end setup using these tools:

  1. Pick the org — if you belong to several, call list_orgs and pass org=<slug> to each tool (single-org accounts can omit it).
  2. (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) — pass fields too for a prompt that returns structured data instead of free text (see prompt-fields) — / create_skill(name, instructions, tool_slugs).
  3. Create the agentcreate_agent(name, instruction=..., provider=..., model=..., allowed_tools=[...]). allowed_tools accepts tool scope strings or slugs.
  4. Wire / adjust itupdate_agent(agent, instruction=..., allowed_tools=..., mounted_skills=[...]). Partial: only the fields you pass change.
  5. 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. Poll get_chat as usual.
    • Building blocks in isolation: test_code_tool(tool, args), test_prompt(prompt, variables) (or test_prompt(prompt, input_text=...) for a schema-bearing prompt) — no chat needed. See the testing doc.
  6. Deploydeploy_agent(agent) to make the draft instruction active. (Skills/code tools/prompts don’t need a deploy step.)
  7. Run itstart_chat(agent, message) → returns a chat_id.
  8. Read the result — poll get_chat(chat_id) until status != “running”; read the final assistant message + outcomes. If it’s “paused” with a pending_hitl_request, answer via respond_to_hitl.

Use list_* / get_* tools at any point to inspect existing entities.