web_search_exa
Perform real-time web searches and scrape content from URLs using AI-powered search. Configure result counts and crawl modes to retrieve relevant website information.
Instructions
Search the web using Exa AI - performs real-time web searches and can scrape content from specific URLs. Supports configurable result counts and returns the content from the most relevant websites.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Websearch query | |
| numResults | No | Number of search results to return (default: 8) | |
| livecrawl | No | Live crawl mode - 'fallback': use live crawling as backup if cached content unavailable, 'preferred': prioritize live crawling (default: 'fallback') | |
| type | No | Search type - 'auto': balanced search (default), 'fast': quick results, 'deep': comprehensive search | |
| contextMaxCharacters | No | Maximum characters for context string optimized for LLMs (default: 10000) |
Implementation Reference
- src/tools/index.ts:206-215 (handler)The handler function for the 'web_search_exa' tool. It validates input parameters using webSearchSchema, performs the Exa search via client.search, formats the results using formatSearchResults, and returns the content in MCP format.case 'web_search_exa': { const params = webSearchSchema.parse(args); const results = await client.search(params); return { content: [{ type: "text", text: formatSearchResults(results) }] }; }
- src/tools/index.ts:18-33 (schema)Zod schema used for input validation of the web_search_exa tool parameters.const webSearchSchema = z.object({ query: z.string().describe("Search query for finding information on the web"), num_results: z.number().optional().default(10).describe("Number of results to return (default: 10, max: 100)"), include_domains: z.array(z.string()).optional().describe("Only include results from these domains"), exclude_domains: z.array(z.string()).optional().describe("Exclude results from these domains"), start_crawl_date: z.string().optional().describe("Start date for crawled content (YYYY-MM-DD)"), end_crawl_date: z.string().optional().describe("End date for crawled content (YYYY-MM-DD)"), start_published_date: z.string().optional().describe("Start date for published content (YYYY-MM-DD)"), end_published_date: z.string().optional().describe("End date for published content (YYYY-MM-DD)"), use_autoprompt: z.boolean().optional().default(true).describe("Let Exa AI optimize the search query"), type: z.enum(['keyword', 'neural', 'magic']).optional().default('neural').describe("Search type: 'keyword' for exact match, 'neural' for semantic search, 'magic' for best results"), category: z.string().optional().describe("Filter by content category (news, blog, research, etc.)"), include_text: z.boolean().optional().default(false).describe("Include extracted text content from pages"), include_highlights: z.boolean().optional().default(false).describe("Include highlighted snippets from pages"), include_summary: z.boolean().optional().default(false).describe("Include AI-generated summaries of pages") });
- src/tools/index.ts:82-154 (registration)Tool registration definition including name, description, and JSON input schema for the web_search_exa tool, returned by getToolDefinitions for MCP listTools handler.name: 'web_search_exa', description: 'Search the web using Exa AI for up-to-date information', inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query for finding information on the web" }, num_results: { type: "number", description: "Number of results to return (default: 10, max: 100)", default: 10 }, include_domains: { type: "array", items: { type: "string" }, description: "Only include results from these domains" }, exclude_domains: { type: "array", items: { type: "string" }, description: "Exclude results from these domains" }, start_crawl_date: { type: "string", description: "Start date for crawled content (YYYY-MM-DD)" }, end_crawl_date: { type: "string", description: "End date for crawled content (YYYY-MM-DD)" }, start_published_date: { type: "string", description: "Start date for published content (YYYY-MM-DD)" }, end_published_date: { type: "string", description: "End date for published content (YYYY-MM-DD)" }, use_autoprompt: { type: "boolean", description: "Let Exa AI optimize the search query", default: true }, type: { type: "string", enum: ["keyword", "neural", "magic"], description: "Search type: 'keyword' for exact match, 'neural' for semantic search, 'magic' for best results", default: "neural" }, category: { type: "string", description: "Filter by content category (news, blog, research, etc.)" }, include_text: { type: "boolean", description: "Include extracted text content from pages", default: false }, include_highlights: { type: "boolean", description: "Include highlighted snippets from pages", default: false }, include_summary: { type: "boolean", description: "Include AI-generated summaries of pages", default: false } }, required: ["query"] }
- src/server.ts:30-37 (registration)Default enabled tools list in ExaServer constructor, including 'web_search_exa' for server tool registration.this.enabledTools = enabledTools || [ 'web_search_exa', 'company_research_exa', 'crawling_exa', 'linkedin_search_exa', 'deep_researcher_start', 'deep_researcher_check' ];