> ## Documentation Index
> Fetch the complete documentation index at: https://platform.minimax.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Server Tools

## What are Server Tools

**Server Tools** are built-in tools hosted and executed automatically by MiniMax on the server side. Unlike traditional Function Calls (client-side tools), you don't need to implement the tool's execution logic or manually return tool results across multiple turns—the model automatically invokes the tool, retrieves the result, and continues generating within a single API request.

<Info>
  This capability is currently in **Beta**; behavior and parameters may change.
</Info>

<CardGroup cols={2}>
  <Card title="Client-side tools (Function Call)" icon="wrench">
    The model returns `tool_use`, **your code** executes it, and you pass `tool_result` back. Requires multiple round trips.
  </Card>

  <Card title="Server Tools" icon="server">
    The model executes the tool and retrieves the result on **MiniMax's servers**, all within a **single request**. You only read the final reply.
  </Card>
</CardGroup>

## Availability

| Capability      | Support                                                    |
| :-------------- | :--------------------------------------------------------- |
| Interface       | **Anthropic Messages API** only (`/anthropic/v1/messages`) |
| Available tools | `web_search`                                               |
| How to use      | Declare the server tool in the request's `tools` array     |

## web\_search

`web_search` lets the model search the web automatically while generating a reply, fetch real-time information, and answer based on the search results. It's ideal for time-sensitive questions that require the latest facts (news, market data, documentation lookups, etc.).

### Declare the tool

Add a tool with `type` set to `web_search_20250305` to your `tools` array:

```json theme={null}
{
  "type": "web_search_20250305",
  "name": "web_search"
}
```

<Info>
  `web_search_20250305` is the **versioned type identifier** of this server tool, following Anthropic's official naming convention: `web_search` is the tool name, and the `20250305` suffix (i.e. 2025-03-05) marks the tool's release version. When the tool's capabilities change, Anthropic ships a new version under a new date suffix — always use the type declared here.
</Info>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.minimax.io/anthropic/v1/messages \
    -H "Content-Type: application/json" \
    -H "x-api-key: ${YOUR_API_KEY}" \
    -H "anthropic-version: 2023-06-01" \
    -d '{
      "model": "MiniMax-M3",
      "max_tokens": 8192,
      "messages": [
        {
          "role": "user",
          "content": "What is the weather in Shanghai?"
        }
      ],
      "tools": [
        {
          "type": "web_search_20250305",
          "name": "web_search"
        }
      ]
    }'
  ```
</CodeGroup>

### Response

Once `web_search` is enabled, the model executes the search on the server side and uses the results to generate its final reply. You don't need to handle `tool_use` / `tool_result` round trips—just read the `text` content blocks in `message.content` to get the answer.

`message.content` returns multiple content blocks in the order the model executed them. A complete search-and-answer flow typically includes the following types:

| Block type               | Description                                                                                                                                               |
| :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `text`                   | Text generated by the model. Both the lead-in before searching and the final answer after searching use this type                                         |
| `server_tool_use`        | The tool call the model issued on the server side. `name` is `web_search`, and `input.query` is the actual search query                                   |
| `web_search_tool_result` | The search results returned by the server. `content` is a list of `web_search_result` items with fields such as `title`, `url`, `page_age`, and `content` |

<Accordion title="Full response example">
  ```json theme={null}
  {
    "id": "069d492820d3562155e88b67fe988b42",
    "type": "message",
    "role": "assistant",
    "model": "MiniMax-M3",
    "content": [
      {
        "text": "Let me search for today's weather in Shanghai.",
        "type": "text"
      },
      {
        "type": "server_tool_use",
        "id": "call_function_aa733q961ql2_1",
        "name": "web_search",
        "input": {
          "query": "Shanghai weather today"
        }
      },
      {
        "type": "web_search_tool_result",
        "tool_use_id": "call_function_aa733q961ql2_1",
        "content": [
          /// ...
          {
            "type": "web_search_result",
            "title": "Shanghai Weather Forecast",
            "url": "http://www.weather.com.cn/textFC/shanghai.shtml",
            "page_age": "2026-07-07 18:00:00",
            "content": "Map-based domestic city weather forecast > Domestic > Shanghai. Today Tue (Jul 7), Wed (Jul 8), Thu (Jul 9) ... Shanghai daytime/nighttime: weather, wind direction & force, high/low temperature. Shanghai - light rain, south wind <3, 28 ..."
          },
          /// ...
        ]
      },
      {
        "text": "Based on the latest search results, here's the weather in Shanghai today (July 8):\n\n## 🌤️ Shanghai Weather Today\n\n- **Conditions**: Mostly cloudy to overcast, with **brief showers or thunderstorms** in some areas\n- **Temperature**: Morning low around 30.3°C, daytime high up to **35–36°C**\n- **Wind**: South to southwest wind force 3–4 (4–5 along the river and coast), shifting to south-southeast at night\n- **Humidity**: Relative humidity 95%–60%, **feels muggy**\n- **Alert**: The Shanghai Meteorological Observatory has issued a **yellow high-temperature warning for the central urban area**\n\n## ⚠️ Tips\n\n1. **Beat the heat**: High temperature and humidity make it feel muggy; wear sunscreen and stay hydrated when heading out.\n2. **Rain & lightning**: Brief thundershowers in some areas—carry an umbrella for both sun and rain.\n3. **Typhoon update**: Typhoon No. 14 \"Bavi\" is extremely strong and is expected to bring noticeable wind and rain to Shanghai and nearby waters on the 11th–13th; keep an eye on later forecasts.\n\n## 📅 Coming days\n\n- **Tomorrow (July 9)**: Cloudy to overcast, brief thunderstorms in some areas, 28–34°C, slight relief\n- **From Friday**: Under the outer circulation of Typhoon \"Bavi,\" frequent showers, dropping temperatures with strong southeast winds\n\nFor a detailed hourly forecast, visit [Weather China – Shanghai](http://www.weather.com.cn/weather/101020100.shtml).",
        "type": "text"
      }
    ],
    "usage": {
      "input_tokens": 3206,
      "output_tokens": 365,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 228,
      "service_tier": "standard"
    },
    "stop_reason": "end_turn",
    "base_resp": {
      "status_code": 0,
      "status_msg": ""
    }
  }
  ```
</Accordion>

<Tip>
  Because the search runs entirely on the server, a single request may take longer than one without tools. Set your client timeout accordingly.
</Tip>

## Notes

1. Server Tools are in **Beta**; behavior and parameters may change at any time.
2. Only the **Anthropic Messages API** supports Server Tools, and only the `web_search` tool is available.
3. Make sure `ANTHROPIC_BASE_URL` is set to `https://api.minimax.io/anthropic`. See the [Anthropic SDK](/api-reference/text-anthropic-api) documentation for details.

If you run into any issues, contact our technical support team at [Model@minimaxi.com](mailto:Model@minimaxi.com).
