Skip to main content
There are two ways to give your AI agent web search: connect the MCP server (zero code), or define search and fetch as tool functions in your framework. The fastest path is to point your agent at the install guide. It will configure itself:
Or connect directly — for example, in Claude Code:
The MCP server exposes two tools: andi_web_search and andi_fetch_url. Your agent can search the web and then fetch full page content from any result. See Build with AI agents for setup snippets for Cursor, VS Code, Codex, and other clients.

Tool definition (custom frameworks)

If your agent framework uses function/tool definitions instead of MCP, define the search tool with parameters and expected output:

Tool execution

When the agent calls the tool, execute the search and return results:

Search then fetch workflow

An agent can search for results, then fetch full content from the most relevant page. This example pins searchMode=deep so every call gets broad coverage before the fetch — omit it to let auto decide per query:

Putting it together

Here’s how the tool fits into an agent loop:

Using format=context for agents

For agents that pass search results directly into conversation context, format=context returns pre-formatted markdown:
format=context reduces the code in your tool executor — no JSON parsing or formatting needed. The tradeoff is less control over result structure.

Next steps

Build with AI agents

MCP server setup for Claude Code, Cursor, and more.

Content retrieval

Full fetch endpoint reference.

Search modes

Automatic effort by default, manual control when you want it.

Error handling

Error codes and retry strategies.