Skip to main content
Glama
joerup

Exa MCP Server

by joerup

web_search_exa

Read-onlyIdempotent

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
NameRequiredDescriptionDefault
queryYesWebsearch query
numResultsNoNumber of search results to return (default: 8)
livecrawlNoLive crawl mode - 'fallback': use live crawling as backup if cached content unavailable, 'preferred': prioritize live crawling (default: 'fallback')
typeNoSearch type - 'auto': balanced search (default), 'fast': quick results, 'deep': comprehensive search
contextMaxCharactersNoMaximum characters for context string optimized for LLMs (default: 10000)

Implementation Reference

  • 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)
            }]
        };
    }
  • 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")
    });
  • 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'
    ];
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, idempotent, and non-destructive behavior. The description adds valuable context beyond this: it mentions 'real-time web searches,' 'scrape content,' and 'returns the content from the most relevant websites,' which clarifies the tool's operational behavior and output format. No contradiction with annotations exists, and the added details enhance understanding of the tool's actions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with a clear main purpose stated first ('Search the web using Exa AI'), followed by key features in a single, efficient sentence. Every phrase adds value without redundancy, making it easy to grasp the tool's core functionality quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (5 parameters, 100% schema coverage, annotations provided, no output schema), the description is reasonably complete. It covers the tool's purpose, key behaviors, and output intent. However, without an output schema, it could benefit from more detail on the structure of returned content (e.g., format, fields) to fully compensate, slightly limiting completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are well-documented in the schema itself. The description adds minimal semantic value beyond the schema, only implying result counts and content return through phrases like 'configurable result counts' and 'returns the content.' This meets the baseline for high schema coverage, but doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search the web using Exa AI - performs real-time web searches and can scrape content from specific URLs.' It specifies the verb (search/scrape) and resource (web/URLs). However, it doesn't explicitly differentiate from its sibling 'get_code_context_exa' which might have overlapping search functionality, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through phrases like 'real-time web searches' and 'scrape content from specific URLs,' suggesting when this tool is appropriate. However, it lacks explicit guidance on when to use this versus the sibling tool 'get_code_context_exa' or any alternatives, and doesn't specify exclusions or prerequisites, leaving room for ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/joerup/exa-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server