What is a web search tool for AI agents?
A web search tool for AI agents is a function the agent calls to query the web and read results before it answers or acts. Model APIs and coding agents ship one built in, such as Claude's web search tool, Claude Code's WebSearch and Codex's web_search. The other option is a dedicated web search API, called as a function or through a web search MCP server.
| Factor | Built into a model API | Built into a coding agent | Dedicated search API (Firecrawl) |
|---|---|---|---|
| What a search returns | An answer with citations to the sources read | Titles and URLs (Claude Code), results from a cached index by default (Codex), a summary (Gemini CLI) | Titles, URLs and query-relevant highlights |
| Reading a full page | A separate fetch tool, where one exists | A fetch tool that returns a model's summary of the page | Full-page Markdown for each result with scrapeOptions |
| Filters | Domain filters on some providers | Domain lists in Claude Code and Codex | Domains, time range, sources such as web, news and images, and categories (research, pdf, developer, gov) |
| Search backend | Fixed to the model provider | Fixed; add an MCP server for another provider | Works with any model, framework or coding agent |
Use a built-in tool when a link or a short answer settles the question. Use a search API when the agent must read whole pages, filter by date or source, or run the same retrieval in Claude Code, Codex, Cursor or Gemini CLI. Built-in fetch tools summarize each page through another model call, which costs tokens and hides the source text (measured in Claude Code).
Firecrawl Search returns ranked results with query highlights, and full-page Markdown when you pass scrapeOptions. With "alexandria" in sources, the response also lists matching Firecrawl Alexandria providers, and /scrape calls one for its data. The keyless Firecrawl MCP server adds search and scrape to any coding agent that loads MCP servers; Firecrawl Alexandria needs a signed-in connection or a key from a team with it enabled.