Skip to main content
Use the Tools API when your application needs one specific supported capability instead of a full Agent Run. Discover the live contract before you call it.

Tools

Discover tools

Each descriptor includes:
  • input_schema, the JSON Schema for arguments.
  • output_schema, the JSON Schema for structured_content, or null when the tool does not declare one.
  • kind, which is sync, async_submit, or job_control.
  • job_family for an asynchronous submit tool.
  • cost_class and side_effect_level when those classifications apply.
The primary call shapes are:
  • sync: the call returns a tool_result.
  • async_submit: the call returns 202 with a tool_job.
  • job_control: use the Jobs endpoints instead. Invoking these tools through REST returns 400 use_job_endpoints.
The catalog reflects the authenticated user’s access and the tools registered in the current deployment. Fetch it at runtime instead of hard-coding the full list. Direct video analysis, cuts, and transcript tools are excluded from this surface. Use an Agent Run or ask_stefanbrain with a hosted video URL in the message.

Capability reference

Use this reference to choose a public capability and MCP profile. Availability is the profile ceiling; your credential and current access still apply. Fetch the live descriptor for exact arguments.

Invoke a tool

The request accepts:
  • arguments: an object that matches the tool’s input_schema.
  • chat: an optional chat_... identifier where activity and artifacts should live.
  • project: an optional proj_... identifier or project UUID.
Schema violations return 400 invalid_tool_arguments. Without chat, StefanBrain reuses or creates the account’s Developer API chat. With project and no chat, it uses that project’s Developer API chat. An inaccessible project returns 404 project_not_found. A chat that belongs to a different project returns 409 chat_project_mismatch.

Address submit tools by project and session

The seven asynchronous submit tools — create_images, edit_image, find_angles, get_meta_ad, research_shortform, review_copy, and review_funnel — also accept project and session inside arguments. A session label gives a workstream its own Developer API — <label> chat within the project. Addressing precedence is: Session labels use 1–128 characters from A–Z, a–z, 0–9, _, ., :, or -. Poll with the returned job id and family. Developer API and MCP job controls can read or cancel your jobs from another chat or session.

Retry submit calls without duplicating work

Send Idempotency-Key on supported submit tools. A repeated key returns the original accepted job instead of starting or charging for another one.
Submit keys are scoped to your account and job family. Both API versions retain keys for 24 hours after acceptance, including across UTC midnight. Retries keep returning the original job during that window and while the job remains active. Once the window ends and the job finishes, reusing the key can start another billed job. Keep the same key, project, session, chat, and input on a retry. A changed request conflicts with a retained key. Use a new key for new work. ask_stefanbrain also accepts idempotency, with the same retention rule. REST and MCP asks share one key space for your account and return the original run. See Retry an ask safely.
A tool-level provider or content failure can return HTTP 200 with is_error: true. Transport, authentication, validation, and limit failures use non-success status codes.
chat_constraints, share_chat, request_connector_connect, collect_web_artifacts, knowledge_search, knowledge_read, generate_hooks, and find_marketing_angles (now find_angles) return 404 tool_not_available with a reason. manage_automations is in-app only and returns 404 tool_not_found, like an unknown tool name. Retired (2026-09-22): create_skill, import_skill, and use_skill were removed from the Developer API. User-authored skills were retired; create_skill and import_skill no longer exist anywhere, and use_skill now only loads StefanBrain’s built-in reference files inside an agent run, so it returns 404 tool_not_found here. @stefanbrain/sdk and @stefanbrain/cli 0.3.0 drop the three tools from their generated types and catalog. Call POST /api/developers/v1/files instead of invoking stage_file through REST, which returns 400 use_files_endpoint. The stage_file tool exists for MCP clients that cannot send a multipart HTTP request. Likewise, use /api/developers/v1/feedback instead of invoking send_feedback or list_feedback through REST, which returns 400 use_feedback_endpoint. See Agent feedback.

Compatibility and renamed tools

Use query_projects for reads and edit_project for writes. Removed project names return a typed tool_unavailable outcome with the corrected call. Omit request.model from create_images. StefanBrain selects the image model; the deprecated input is accepted and ignored. Compatibility responses include a typed notice with the exact fix. An input is eligible for removal only after 30 consecutive zero-usage production days; active usage extends support.

Jobs

Handle an asynchronous job

An async_submit tool returns a job envelope similar to:
Use the URLs in the response. Their underlying endpoints are:
New jobs submitted through the direct Tools API use these families: static_ad, cro_funnel_review, angle_finder, shortform_research, copy_chief, and meta_ad_lookup. Parked ask_stefanbrain answers poll under mcp_ask at GET /api/developers/v1/jobs/mcp_ask/{run_id}?chat={chat}. Poll the status URL every 3–10 seconds until the top-level status is succeeded, failed, or cancelled, then fetch the result URL. data carries run_id, family, status, progress_message, progress, and error; the result call adds data.result. recommended_poll_after_ms is currently null. Job status can be queued, running, succeeded, failed, or cancelled. Status, result, and cancel calls return an object: "job" envelope:
  • status is lifted to the top level for a stable polling loop.
  • recommended_poll_after_ms is the current delay hint, or null.
  • data contains the family-specific status or result payload.
  • content preserves the tool’s content blocks.
  • is_error tells you whether the tool-level operation failed.
  • error contains a typed code and readable message when is_error is true.
An HTTP 200 does not guarantee that the tool or job succeeded. Always check is_error, error, and the job’s terminal status.
Job status, result, and cancellation are scoped to your account and the job family, regardless of the calling chat. Another account receives 404 job_not_found.

Download job files

Jobs that produce files return data.result.kind: "files" with a summary and each file’s workspace path. This holds in every chat, including a Developer API chat that has only taken tool calls. Static-ad jobs write one image and one .copy.md file per creative, plus an ad.json manifest and a brief.md when the run produced one. Both GET /api/developers/v1/jobs/{id} and the family /result route include artifacts in the result payload. Match each artifact’s path to a produced file and download download.uri without an authorization header. Links last 10 minutes; read the result again to renew them. Revoking the credential or withdrawing file access invalidates the link. See Files. Inline results return data.result.kind: "inline" with summary and data. See the generated REST reference for exact per-tool schemas. Use Agent Runs when StefanBrain should plan and complete a multi-step task.