Skip to main content
Use Web Search when you need the assistant to run a quick web query and return results.

Prerequisites

Requirements

  • Tool spec: { "name": "web_search", "type": "web_search_v1" }
  • No tool_context required

Basic request and response

This example validates a request that enables the web search tool:
Example response:
To run the request, send the same body to POST /messages.

Tips

  • Use a focused query to reduce noisy results.
  • Combine with a system prompt to control summarization style.

Next steps

  • Learn how messages return tool blocks: Messages