For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://modelgates.ai/docs/_mcp/server.

Server Tools

Server tools are currently in beta. The API and behavior may change.

Server tools are specialized tools operated by ModelGates that any model can call during a request. When a model decides to use a server tool, ModelGates executes it server-side and returns the result to the model — no client-side implementation needed.

Server Tools vs Plugins vs User-Defined Tools

Server ToolsPluginsUser-Defined Tools
Who decides to use itThe modelAlways runsThe model
Who executes itModelGatesModelGatesYour application
Call frequency0 to N times per requestOnce per request0 to N times per request
Specified viatools arrayplugins arraytools array
Type prefixmodelgates:*N/Afunction

Server tools are tools the model can invoke zero or more times during a request. ModelGates handles execution transparently.

Plugins inject or mutate a request or response to add functionality (e.g. response healing, PDF parsing). They always run once when enabled.

User-defined tools are standard function-calling tools where the model suggests a call and your application executes it.

Available Server Tools

ToolTypeDescription
Web Searchmodelgates:web_searchSearch the web for current information
Datetimemodelgates:datetimeGet the current date and time
Image Generationmodelgates:image_generationGenerate images from text prompts
Web Fetchmodelgates:web_fetchFetch and extract content from URLs

How Server Tools Work

  1. You include one or more server tools in the tools array of your API request.
  2. The model decides whether and when to call each server tool based on the user's prompt.
  3. ModelGates intercepts the tool call, executes it server-side, and returns the result to the model.
  4. The model uses the result to formulate its response. It may call the tool again if needed.

Server tools work alongside your own user-defined tools — you can include both in the same request.

Quick Start

Add server tools to the tools array using the modelgates: type prefix:

typescript
const response = await fetch('https://modelgates.ai/api/v1/chat/completions', {  method: 'POST',  headers: {    Authorization: 'Bearer {{API_KEY_REF}}',    'Content-Type': 'application/json',  },  body: JSON.stringify({    model: '{{MODEL}}',    messages: [      {        role: 'user',        content: 'What are the latest developments in AI?'      }    ],    tools: [      { type: 'modelgates:web_search' },      { type: 'modelgates:datetime' }    ]  }),}); const data = await response.json();console.log(data.choices[0].message.content);
python
import requests response = requests.post(  "https://modelgates.ai/api/v1/chat/completions",  headers={    "Authorization": f"Bearer {{API_KEY_REF}}",    "Content-Type": "application/json",  },  json={    "model": "{{MODEL}}",    "messages": [      {        "role": "user",        "content": "What are the latest developments in AI?"      }    ],    "tools": [      {"type": "modelgates:web_search"},      {"type": "modelgates:datetime"}    ]  }) data = response.json()print(data["choices"][0]["message"]["content"])
bash
curl https://modelgates.ai/api/v1/chat/completions \  -H "Authorization: Bearer {}" \  -H "Content-Type: application/json" \  -d '{    "model": "{{MODEL}}",    "messages": [      {        "role": "user",        "content": "What are the latest developments in AI?"      }    ],    "tools": [      {"type": "modelgates:web_search"},      {"type": "modelgates:datetime"}    ]  }'

Combining with User-Defined Tools

Server tools and user-defined tools can be used in the same request:

json
{  "model": "openai/gpt-5.2",  "messages": [...],  "tools": [    { "type": "modelgates:web_search", "parameters": { "max_results": 3 } },    { "type": "modelgates:datetime" },    {      "type": "function",      "function": {        "name": "get_stock_price",        "description": "Get the current stock price for a ticker symbol",        "parameters": {          "type": "object",          "properties": {            "ticker": { "type": "string" }          },          "required": ["ticker"]        }      }    }  ]}

The model can call any combination of server tools and user-defined tools. ModelGates executes the server tools automatically, while your application handles the user-defined tool calls as usual.

Usage Tracking

Server tool usage is tracked in the response usage object:

json
{  "usage": {    "input_tokens": 105,    "output_tokens": 250,    "server_tool_use": {      "web_search_requests": 2    }  }}

Next Steps