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

# Overview

> Use provider-hosted capabilities such as web search, code execution, and image creation without writing local tool handlers.

Server-side tools run entirely on the provider's infrastructure. They stream
progress events, produce final deliverables, and keep your application logic
focused on orchestration instead of implementation.

## Provider Support

| Provider             | Tools Available                                             |
| -------------------- | ----------------------------------------------------------- |
| **OpenAI Responses** | Web Search, File Search, Image Generation, Code Interpreter |
| **xAI Responses**    | Web Search, X Search, File Search, Code Interpreter, MCP    |
| **Google**           | Google Search, Code Execution                               |
| **Anthropic**        | Web Search, Web Fetch, Code Interpreter                     |

## Enabling Tools

Each provider uses its own options class and tool enum:

### OpenAI Responses

```dart theme={null}
final agent = Agent(
  'openai-responses',
  chatModelOptions: const OpenAIResponsesChatModelOptions(
    serverSideTools: {
      OpenAIServerSideTool.webSearch,
      OpenAIServerSideTool.codeInterpreter,
    },
  ),
);
```

### xAI Responses

```dart theme={null}
final agent = Agent(
  'xai-responses',
  chatModelOptions: const XAIResponsesChatModelOptions(
    serverSideTools: {
      XAIServerSideTool.webSearch,
      XAIServerSideTool.codeInterpreter,
    },
  ),
);
```

### Google

```dart theme={null}
final agent = Agent(
  'google',
  chatModelOptions: const GoogleChatModelOptions(
    serverSideTools: {
      GoogleServerSideTool.googleSearch,
      GoogleServerSideTool.codeExecution,
    },
  ),
);
```

### Anthropic

```dart theme={null}
final agent = Agent(
  'anthropic',
  chatModelOptions: const AnthropicChatOptions(
    serverSideTools: {
      AnthropicServerSideTool.webSearch,
      AnthropicServerSideTool.codeInterpreter,
    },
  ),
);
```

Pick the tools you want per request. Providers default to their own safe
configuration if you omit the set.

## Streaming Metadata

Each tool streams structured metadata under a predictable key:

| Tool             | Metadata key                   |
| ---------------- | ------------------------------ |
| Web search       | `metadata['web_search']`       |
| File search      | `metadata['file_search']`      |
| Image generation | `metadata['image_generation']` |
| Code interpreter | `metadata['code_interpreter']` |

Metadata is delivered on every `ChatResult` during streaming, which you can use
to show live progress, log it, or feed it into analytics.

```dart theme={null}
await for (final chunk in agent.sendStream('Recent Dart news?')) {
  final searchEvents = chunk.metadata['web_search'] as List?;
  if (searchEvents != null) {
    for (final event in searchEvents) {
      stdout.writeln('stage: ${event['type']}');
    }
  }
}
```

## Message Content

Final deliverables (images, generated files, synthesized summaries) arrive as
normal message parts so you can handle them with the usual `ChatMessage` APIs.

## Configuration Blocks

Each tool exposes an optional configuration object. Configuration objects are
provider-specific:

```dart theme={null}
// OpenAI Responses
final agent = Agent(
  'openai-responses',
  chatModelOptions: OpenAIResponsesChatModelOptions(
    serverSideTools: const {OpenAIServerSideTool.webSearch},
    webSearchConfig: const WebSearchConfig(
      contextSize: WebSearchContextSize.high,
      followupQuestions: true,
    ),
  ),
);
```

## OpenAI Responses Tools

* [Web Search](/server-side-tools/web-search) - Search the web and weave results
  into responses
* [File Search](/server-side-tools/file-search) - Search provider-hosted files
  and vector stores
* [Image Generation](/server-side-tools/image-generation) - Generate images with
  streaming previews
* [Code Interpreter](/server-side-tools/code-interpreter) - Execute Python code
  in a sandbox

## Google Tools

* [Google Search](/server-side-tools/google-search) - Search with Google
  Grounding
* [Code Execution](/server-side-tools/google-code-execution) - Execute Python in
  Google's sandbox

## Anthropic Tools

* [Web Search](/server-side-tools/anthropic-web-search) - Search the web via
  Anthropic
* [Web Fetch](/server-side-tools/anthropic-web-fetch) - Fetch and process web
  pages
* [Code Interpreter](/server-side-tools/anthropic-code-interpreter) - Execute
  Python via Anthropic

## Examples

* [OpenAI server-side
  tools](https://github.com/csells/dartantic_ai/tree/main/packages/dartantic_ai/example/bin/server_side_tools)
* [Google server-side
  tools](https://github.com/csells/dartantic_ai/tree/main/packages/dartantic_ai/example/bin/server_side_tools_google)
* [Anthropic server-side
  tools](https://github.com/csells/dartantic_ai/tree/main/packages/dartantic_ai/example/bin/server_side_tools_anthropic)

## Related Topics

* [Media Generation](/media-generation) - Generate images, PDFs, and files
  across providers
* [Thinking Metadata](/thinking) - Combine reasoning output with tool progress
* [Tool Calling](/tool-calling) - Define your own local tools
