Claude On Google Cloud
← All lessons
Lesson 39Claude On Google Cloud

The web search tool

Summary audio

Spoken summary — press play to read along: the line being spoken stays near the top.

Study notes

Web Search Tool Study Notes

**I. Core Functionality**

  • Purpose: A built-in tool in Claude that allows it to search the web for current or specialized information.
  • Operation: Claude performs the search entirely; no external implementation is required.
  • Use Case: Ideal for answering questions about rapidly changing topics (e. g. , current events in quantum computing).

**II. Defining the Web Search Schema**

  • Requirement: The functionality is enabled by providing a specific Web Search Schema within the request.
  • Key Schema Fields:
  • type: Defines the tool (e. g. , web search underscore 2025 0305).
  • name: A descriptive name for the tool (e. g. , web underscore search).
  • max uses: Sets a limit on the total number of searches Claude can perform (e. g. , set to five).
  • Search Iteration: A single search can yield multiple results, and Claude may perform follow-up searches based on the initial content.

**III. Advanced Schema Control**

  • Goal: To ensure the quality and reliability of the information retrieved.
  • allowed domains Field: This field constrains Claude's search to only specific, trusted websites (e. g. , limiting searches to nih. gov).
  • Benefit: Prevents the model from relying on unverified or low-quality AI-generated content from general blogs.

**IV. Understanding the Response Structure** When Claude uses the tool, the response is a complex list of blocks, which must be parsed by the application:

  • Text Block: Provides the framing or introductory text from Claude.
  • Server Tool Use Block: Contains the exact query that Claude generated to perform the search.
  • Web Search Tool Result Block: A container listing all the search results received.
  • Individual Web Search Result Block: Contains the specific metadata for a result (e. g. , page title and URL).
  • Final Answer (Text Blocks): The final response to the user's question.
  • Citations List: Text blocks that support the statements made in the final answer, linking back to specific web pages.

**V. UI/Application Implementation**

  • Text Blocks: Should be rendered as standard plain text.
  • Web Search/Citation Blocks: Must be rendered in a way that clearly shows the user the source of the information.
  • Source Display: When a citation is found, the UI should display the domain, title, URL, and the exact cited text to provide transparency.

Takeaways

  • The Web Search Tool allows Claude to retrieve current or specialized information by performing the search entirely internally.
  • Tool functionality is enabled by providing a specific Web Search Schema, which can be restricted using the allowed domains field to ensure information quality.
  • The tool's output is a complex, structured list of blocks (e. g. , Text Block, Web Search Tool Result Block) that the application must parse.
  • The user interface must clearly display source details (domain, title, URL, and cited text) to provide full transparency to the user.
Flashcards 7 cards
Question
click to reveal · ←/→
Answer
click to flip back
Export to Anki (.tsv) ↓
Knowledge check 6 questions