For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a product
    • Setting up a chat surface
    • Setting up an API surface
    • Setting up an MCP surface
    • Setting up an A2A surface
    • Setting up a Slack surface
    • Setting up a webhook surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to MCP clients
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and editing flows
    • Flow step types overview
    • Agent and flow templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
    • Braintrust (tracing)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Managing secrets
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate limits and usage
    • Managing Runtype with Claude
    • Agent skills
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • When to use runtime tools
  • Tool types
  • External
  • Custom
  • Flow
  • Subagent
  • Dynamic subagents (spawn_subagent)
  • Passing runtime tools in a dispatch request
  • Secrets
  • Limits
  • Next steps
Tools

Runtime tools

Was this page helpful?
Previous

What are Evals?

Next
Built with

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 four types:

External

Call any HTTP API. Configure the URL, method, headers, and body with {{parameter}} template variables.

1{
2 "name": "get_weather",
3 "description": "Get current weather for a city",
4 "toolType": "external",
5 "parametersSchema": {
6 "type": "object",
7 "properties": {
8 "city": { "type": "string" }
9 },
10 "required": ["city"]
11 },
12 "config": {
13 "url": "https://api.weather.com/v1/current?city={{city}}",
14 "method": "GET",
15 "headers": {
16 "authorization": "Bearer {{secrets.api_key}}"
17 }
18 }
19}

Custom

Execute sandboxed JavaScript, TypeScript, or Python code.

1{
2 "name": "calculate_discount",
3 "description": "Calculate discount percentage",
4 "toolType": "custom",
5 "parametersSchema": {
6 "type": "object",
7 "properties": {
8 "price": { "type": "number" },
9 "discount": { "type": "number" }
10 },
11 "required": ["price", "discount"]
12 },
13 "config": {
14 "code": "return { discounted_price: price * (1 - discount / 100) }",
15 "timeout": 5000,
16 "language": "javascript"
17 }
18}

Flow

Execute another saved Runtype Flow as a tool.

1{
2 "name": "analyze_sentiment",
3 "description": "Run sentiment analysis flow",
4 "toolType": "flow",
5 "parametersSchema": {
6 "type": "object",
7 "properties": {
8 "text": { "type": "string" }
9 },
10 "required": ["text"]
11 },
12 "config": {
13 "flowId": "flow_abc123",
14 "parameterMapping": { "input_text": "text" },
15 "outputMapping": "sentiment_result"
16 }
17}

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 agent field, with no saved agent. Set exactly one of agentId or agent.
  • Dynamic — let the parent agent decide at runtime what to delegate. See dynamic subagents below.
1{
2 "name": "research_topic",
3 "description": "Spawn a research subagent",
4 "toolType": "subagent",
5 "parametersSchema": {
6 "type": "object",
7 "properties": {
8 "task": { "type": "string" }
9 },
10 "required": ["task"]
11 },
12 "config": {
13 "agentId": "agent_abc123",
14 "allowedTools": ["builtin:exa", "builtin:firecrawl"],
15 "maxTurns": 5,
16 "outputFormat": "text"
17 }
18}

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.

FieldDefaultDescription
agentId—Saved agent to run as the child. Set this or agent, not both.
agent—Inline agent definition (runtime export shape).
allowedToolsrequiredTool IDs the child may use. Subset of the parent’s tools.
maxTurns5Maximum agent-loop iterations for the child.
maxCostparent’s remaining budgetSpend cap for the child; its cost rolls up into the parent.
timeoutMs300000 (5 min)Time limit for the whole child run.
outputFormattextHow the result returns: text, json, or last_message.
inheritMessagesfalseWhen true, the parent’s current messages seed the child’s context.
taskTemplate—Template the child’s first user message from the parent’s tool-call parameters (e.g. {{topic}}).

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.

1{
2 "subagentConfig": {
3 "toolPool": ["builtin:exa", "mcp:linear:*"],
4 "defaultMaxTurns": 5,
5 "maxTurnsLimit": 10,
6 "maxSpawnsPerRun": 5,
7 "allowNesting": false
8 }
9}
FieldDefaultDescription
toolPoolrequiredTools the parent may grant to spawned subagents. Subset of the parent’s tools.
defaultMaxTurns5Default turn cap per spawned subagent.
maxTurnsLimit10Hard ceiling the model cannot exceed.
maxSpawnsPerRun5Maximum subagents per parent run.
defaultModelparent’s modelModel used for spawned subagents.
allowNestingfalseWhether a subagent may itself spawn subagents.
defaultTimeoutMs300000 (5 min)Default time limit per spawned subagent.

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.

Passing runtime tools in a dispatch request

Include runtime tools in the tools.runtimeTools array on a prompt step:

1{
2 "flow": {
3 "name": "My Assistant",
4 "steps": [
5 {
6 "id": "step-1",
7 "type": "prompt",
8 "name": "Assistant",
9 "order": 1,
10 "enabled": true,
11 "config": {
12 "model": "gpt-5.4-mini",
13 "systemPrompt": "You are a helpful assistant.",
14 "tools": {
15 "runtimeTools": [
16 {
17 "name": "search_web",
18 "description": "Search the web",
19 "toolType": "external",
20 "parametersSchema": {
21 "type": "object",
22 "properties": {
23 "query": { "type": "string" }
24 },
25 "required": ["query"]
26 },
27 "config": {
28 "url": "https://api.search.com/search?q={{query}}",
29 "method": "GET"
30 }
31 }
32 ]
33 }
34 }
35 }
36 ]
37 },
38 "options": {
39 "streamResponse": true,
40 "flowMode": "virtual"
41 }
42}

Runtime tools can be combined with saved tools and built-in tools in the same step:

1{
2 "tools": {
3 "toolIds": ["tool_abc123", "builtin:exa"],
4 "runtimeTools": [
5 { "name": "my_runtime_tool", "..." : "..." }
6 ]
7 }
8}

Secrets

Runtime tools can reference credentials passed in the secrets field of the dispatch request. Secrets are never logged or returned in responses.

1{
2 "secrets": {
3 "api_key": "your-api-key"
4 }
5}

Reference them in tool configs with {{secrets.key_name}}.

Limits

LimitValue
Max runtime tools per request50 (across all steps)
Timeout (custom code tools)30 seconds

Next steps

  • Creating custom tools — saved custom code tools
  • Creating external tools — saved HTTP API tools
  • What are Tools? — tool types overview