Tools and preset agents
The Model Gateway's Responses API (/v1/responses) is an agentic entry point. Give the model a task and a set of
gateway-hosted tools, and the gateway runs the tool-call loop for you: it dispatches each tool call the model makes,
feeds the result back, and repeats until the model returns a final answer, with token usage aggregated across the
whole run. By default, the gateway returns one buffered response. Set "stream": true to receive the trace as
Server-Sent Events while the loop runs. You get multi-step, tool-using behavior from a single API call, with no
orchestration to build or host.
Tools over MCP
Tools come from MCP servers: the built-in server of each RAG endpoint, the MCP servers your team connects, and the MCP servers the platform runs from the MCP catalog. The same tools work in Chat and through the API. See What is a tool? for the concept, Connect an MCP server to add a server, Deploy MCP servers to run one from the catalog, and Set up OAuth for MCP servers when each user must sign in to it. An administrator creates the catalog entries. See Create and manage MCP catalog entries.
Use tools through the API
Use the Responses API to discover the Model Gateway tools available to your API key, let a model call them, and inspect the complete tool-calling trace.
→ Use Model Gateway tools with the Responses API
The Messages API (/v1/messages) runs the same gateway tools when you declare them in tools, and returns each call
and its result as cm_gateway MCP blocks.
→ Use gateway tools with the Messages API
Access control
Every tool call is authorized, just like model and RAG access. A request only sees and calls tools from the MCP
servers its caller may use. A tenant's server can be used by its administrators, the tenant's Owners, and the users
and groups added under Users, or by everyone in the tenant when Share with everyone in this tenant is on. A
platform server can be used in the tenants it is shared with. A request can narrow its tools further with
allowed_tools.
Client-side tools
For client-driven agents — coding assistants and similar harnesses — the client runs the agent loop. Local tools such as the filesystem and shell execute on the client, while gateway-hosted RAG and MCP tools are available from the Model Gateway's remote MCP endpoint.
See Configure coding agents for an OpenCode setup guide and the settings used by other OpenAI-compatible coding agents.