Runtime tools
Runtime tools are tool definitions passed inline with a dispatch API request, without saving them to the platform first. They support the same execution types as saved tools.
When to use runtime tools
- SDK-driven workflows that need dynamic tool definitions
- Temporary tools that do not need to persist in the database
- Testing tool configurations before saving them
- Self-referential tools (e.g., an Agent calling the Runtype API itself)
Tool types
Runtime tools support five types:
External
Call any HTTP API. Configure the URL, method, headers, and body with {{parameter}} template variables.
Custom
Execute sandboxed JavaScript, TypeScript, or Python code.
Flow
Execute another saved Runtype Flow as a tool.
Subagent
Spawn a focused child agent with its own context window and a restricted tool subset. The child runs in isolation — it cannot see the parent’s conversation — and only its final result returns to the parent. This keeps the parent’s context clean for a narrow sub-task that may take several tool calls.
Subagents come in three forms:
- Saved — point at an existing agent by
agentId. The saved agent is org-scoped and ownership-checked. - Inline — define the child agent’s shape directly in the tool’s
agentfield, with no saved agent. Set exactly one ofagentIdoragent. - Dynamic — let the parent agent decide at runtime what to delegate. See dynamic subagents below.
allowedTools is required and is intersected with the parent’s available tools, so the child can never use a tool the parent itself lacks (no privilege escalation). Use wildcards like mcp:* or builtin:*, or an empty array [] for a model-only child.
Dynamic subagents (spawn_subagent)
Instead of pre-defining a child, you can let an agent spin off focused subagents on its own. Add a subagentConfig to the agent’s tools configuration and Runtype adds a built-in spawn_subagent tool that the model can call, choosing the task, the tools to grant, and an optional system prompt at runtime.
The model grants only tools from toolPool, and that pool is itself a subset of the parent’s resolved tools — the same no-escalation rule applies. By default subagents cannot spawn their own subagents.
Local
Local tools run on the calling client, not on Runtype. When the model calls one, the run pauses and surfaces the tool call to your SDK client (the dashboard, CLI, or Persona widget), which executes it out-of-band and resumes the run with the result. Runtype never resolves a local tool server-side. Use them for actions only the client can perform — prompting the end user, reading local state, or anything that must happen in the caller’s environment.
Passing runtime tools in a dispatch request
Include runtime tools in the tools.runtimeTools array on a prompt step:
Runtime tools can be combined with saved tools and built-in tools in the same step:
Secrets
Runtime tools can reference credentials passed in the secrets field of the dispatch request. Secrets are never logged or returned in responses.
Reference them in tool configs with {{secrets.key_name}}.
Limits
Next steps
- Creating custom tools — saved custom code tools
- Creating external tools — saved HTTP API tools
- What are Tools? — tool types overview