Overview
Code Mode is useful when you connect many MCP servers and do not want every model request to include every tool definition. Instead of exposing each tool directly, ModRouter exposes a compact set of meta-tools that let the model discover tool definitions and execute tool orchestration code in a sandbox. Use Code Mode when:- You have several MCP servers connected.
- Workflows require multiple tool calls.
- Tool definitions take too much context.
- Intermediate tool results do not all need to be sent back to the model.
How It Works
Code Mode exposes meta-tools such as:
The model reads only the tool definitions it needs, writes orchestration code, and receives a compact result.
