Overview
Agent Mode lets ModRouter run selected MCP tools automatically when a model requests them. This is useful for workflows where the model should call tools, receive results, and continue until it can produce a final answer.
When Agent Mode runs:
- The model returns one or more tool calls.
- ModRouter executes tools that are configured for auto-execution.
- Tool results are sent back to the model.
- The loop continues until the model returns a final answer or the maximum depth is reached.
Agent Mode is not compatible with streaming responses. Use non-streaming chat or responses endpoints when auto-executing tools.
Use tools_to_execute to make tools available and tools_to_auto_execute to allow selected tools to run without application-side approval.
Only tools included in tools_to_execute can be auto-executed.
Send a Request
Go SDK
Only mark deterministic, low-risk tools for auto-execution. For tools that write files, trigger external actions, or make irreversible changes, return the tool call to your application and ask for approval before execution.