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

# Server-Side Tools

> Use provider-native tools like web search and code execution

Some LLM providers offer **server-side tools** that execute on their infrastructure -- no client-side code needed. The model decides when to use them.

## Anthropic Server Tools

### Web Search

```typescript theme={null}
const agent = new Agent({
  name: 'Research Agent',
  instructions: 'Search the web to answer questions with citations.',
  model: anthropic('claude-sonnet-4-6'),
  modelConfig: {
    serverTools: [
      { type: 'web_search_20250305', name: 'web_search' }
    ]
  }
});

const result = await agent.process({
  message: 'What are the latest AI breakthroughs this week?'
});
```

### Code Execution

```typescript theme={null}
const agent = new Agent({
  name: 'Data Analyst',
  instructions: 'Analyze data using Python code.',
  model: anthropic('claude-sonnet-4-6'),
  modelConfig: {
    serverTools: [
      { type: 'code_execution_20250825', name: 'code_execution' }
    ]
  }
});
```

### Both Together

```typescript theme={null}
modelConfig: {
  serverTools: [
    { type: 'web_search_20250305', name: 'web_search' },
    { type: 'code_execution_20250825', name: 'code_execution' }
  ]
}
```

## xAI Server Tools

xAI Grok models support native web search, X/Twitter search, and code execution. These work via the Responses API.

<Note>
  xAI native tools (web\_search, x\_search, code\_interpreter) require the Responses API format, which is not yet proxied through Runflow. Coming soon. For now, use Anthropic server tools or custom function tools for web search.
</Note>

## Provider Support

| Provider  | Web Search            | Code Execution            | X Search    |
| --------- | --------------------- | ------------------------- | ----------- |
| Anthropic | `web_search_20250305` | `code_execution_20250825` | -           |
| xAI       | Coming soon           | Coming soon               | Coming soon |
| OpenAI    | -                     | -                         | -           |
| Gemini    | -                     | -                         | -           |
| Groq      | -                     | -                         | -           |

## Testing in Prompt Studio

Test server tools in the Portal:

1. Open **Prompts** with an **Anthropic** provider selected
2. Click the config icon -- you'll see **Search** and **Code** buttons
3. Click **Search** to enable web search
4. Ask a question that requires current information -- the model will search the web automatically

<Note>
  Server tools are only available for Anthropic providers in the Prompt Studio. Web search adds latency (5-15 seconds) as the model performs real web queries.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Structured Output" icon="brackets-curly" href="/advanced/structured-output">
    Get guaranteed JSON responses
  </Card>

  <Card title="Reasoning" icon="brain" href="/advanced/reasoning">
    Enable chain-of-thought thinking
  </Card>
</CardGroup>
