Skip to main content
Combines web_search, web_fetch, and code_execution in a multi-turn conversation. Each follow-up depends on server tool blocks preserved in history from the previous turn.
server_tools_multi_turn.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Anthropic API key

4

Run the example

Save the code above as server_tools_multi_turn.py, then run:
Full source: cookbook/90_models/anthropic/server_tools_multi_turn.py