Tools extend AI capabilities beyond text generation, allowing your flows to call APIs, execute code, search the web, generate images, and integrate with external services.
Runtype supports several types of tools:
Tools are configured in the tools object of a prompt step:
The toolCallStrategy controls how the model uses tools:
External tools make HTTP requests to any API:
Variable substitution: Use {{paramName}} in URLs and headers. Access secrets via {{secrets.keyName}}.
Execute JavaScript in a secure sandbox:
Provider-specific tools that work with compatible models:
MCP (Model Context Protocol) servers provide rich integrations. There are two ways to use them:
Configure once in your account, use anywhere by tool ID:
Tool ID format: mcp:<serverName>:<toolName>
Pass server config inline for dynamic credentials:
See MCP Servers Guide for detailed MCP documentation.
Define tools inline without saving them:
Runtime tools are ideal for:
See Runtime Tools Guide for more details.
Mix different tool types in one prompt:
Never hardcode API keys. Use the secrets field:
Access in tool configs: {{secrets.weather_api_key}}
Security: Secrets are never logged, stored, or returned in responses.
Set maxToolCalls to prevent infinite loops. Start with 5-10 for simple tasks, increase for complex agents.
Tool descriptions help the model understand when to use each tool. Be specific about inputs and outputs.
Use required when the task needs external data. Use auto for optional augmentation.
External APIs can fail. Consider error handling in your flow design or use the errorHandling config option.