Skip to main content
Glama
NYO2008

Firecrawl MCP Server

by NYO2008

firecrawl_search

Search the web for specific information and extract content from results to find relevant data across multiple websites.

Instructions

Search the web and optionally extract content from search results.

Best for: Finding specific information across multiple websites, when you don't know which website has the information; when you need the most relevant content for a query. Not recommended for: When you already know which website to scrape (use scrape); when you need comprehensive coverage of a single website (use map or crawl). Common mistakes: Using crawl or map for open-ended questions (use search instead). Prompt Example: "Find the latest research papers on AI published in 2023." Usage Example:

{
  "name": "firecrawl_search",
  "arguments": {
    "query": "latest AI research papers 2023",
    "limit": 5,
    "lang": "en",
    "country": "us",
    "scrapeOptions": {
      "formats": ["markdown"],
      "onlyMainContent": true
    }
  }
}

Returns: Array of search results (with optional scraped content).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
limitNoMaximum number of results to return (default: 5)
langNoLanguage code for search results (default: en)
countryNoCountry code for search results (default: us)
tbsNoTime-based search filter
filterNoSearch filter
locationNoLocation settings for search
scrapeOptionsNoOptions for scraping search results

Implementation Reference

  • The handler function for the 'firecrawl_search' tool. Validates input with isSearchOptions, performs the search using the Firecrawl client, formats the results including URLs, titles, descriptions, and optional markdown content, and handles errors.
          case 'firecrawl_search': {
            if (!isSearchOptions(args)) {
              throw new Error('Invalid arguments for firecrawl_search');
            }
            try {
              const response = await withRetry(
                async () =>
                  client.search(args.query, { ...args, origin: 'mcp-server' }),
                'search operation'
              );
    
              if (!response.success) {
                throw new Error(
                  `Search failed: ${response.error || 'Unknown error'}`
                );
              }
    
              // Format the results
              const results = response.data
                .map(
                  (result) =>
                    `URL: ${result.url}
    Title: ${result.title || 'No title'}
    Description: ${result.description || 'No description'}
    ${result.markdown ? `\nContent:\n${result.markdown}` : ''}`
                )
                .join('\n\n');
    
              return {
                content: [{ type: 'text', text: trimResponseText(results) }],
                isError: false,
              };
            } catch (error) {
              const errorMessage =
                error instanceof Error
                  ? error.message
                  : `Search failed: ${JSON.stringify(error)}`;
              return {
                content: [{ type: 'text', text: trimResponseText(errorMessage) }],
                isError: true,
              };
            }
          }
  • The Tool definition for 'firecrawl_search' including name, detailed description, and comprehensive inputSchema specifying parameters like query, limit, lang, country, scrapeOptions, etc.
    const SEARCH_TOOL: Tool = {
      name: 'firecrawl_search',
      description: `
    Search the web and optionally extract content from search results.
    
    **Best for:** Finding specific information across multiple websites, when you don't know which website has the information; when you need the most relevant content for a query.
    **Not recommended for:** When you already know which website to scrape (use scrape); when you need comprehensive coverage of a single website (use map or crawl).
    **Common mistakes:** Using crawl or map for open-ended questions (use search instead).
    **Prompt Example:** "Find the latest research papers on AI published in 2023."
    **Usage Example:**
    \`\`\`json
    {
      "name": "firecrawl_search",
      "arguments": {
        "query": "latest AI research papers 2023",
        "limit": 5,
        "lang": "en",
        "country": "us",
        "scrapeOptions": {
          "formats": ["markdown"],
          "onlyMainContent": true
        }
      }
    }
    \`\`\`
    **Returns:** Array of search results (with optional scraped content).
    `,
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query string',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results to return (default: 5)',
          },
          lang: {
            type: 'string',
            description: 'Language code for search results (default: en)',
          },
          country: {
            type: 'string',
            description: 'Country code for search results (default: us)',
          },
          tbs: {
            type: 'string',
            description: 'Time-based search filter',
          },
          filter: {
            type: 'string',
            description: 'Search filter',
          },
          location: {
            type: 'object',
            properties: {
              country: {
                type: 'string',
                description: 'Country code for geolocation',
              },
              languages: {
                type: 'array',
                items: { type: 'string' },
                description: 'Language codes for content',
              },
            },
            description: 'Location settings for search',
          },
          scrapeOptions: {
            type: 'object',
            properties: {
              formats: {
                type: 'array',
                items: {
                  type: 'string',
                  enum: ['markdown', 'html', 'rawHtml'],
                },
                description: 'Content formats to extract from search results',
              },
              onlyMainContent: {
                type: 'boolean',
                description: 'Extract only the main content from results',
              },
              waitFor: {
                type: 'number',
                description: 'Time in milliseconds to wait for dynamic content',
              },
            },
            description: 'Options for scraping search results',
          },
        },
        required: ['query'],
      },
    };
  • src/index.ts:955-966 (registration)
    Registration of all tools including SEARCH_TOOL in the listTools request handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        SCRAPE_TOOL,
        MAP_TOOL,
        CRAWL_TOOL,
        CHECK_CRAWL_STATUS_TOOL,
        SEARCH_TOOL,
        EXTRACT_TOOL,
        DEEP_RESEARCH_TOOL,
        GENERATE_LLMSTXT_TOOL,
      ],
    }));
  • Type guard helper function to validate arguments for firecrawl_search tool.
    function isSearchOptions(args: unknown): args is SearchOptions {
      return (
        typeof args === 'object' &&
        args !== null &&
        'query' in args &&
        typeof (args as { query: unknown }).query === 'string'
      );
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool can 'optionally extract content from search results' and shows scrapeOptions in the usage example, which adds useful context about content extraction capabilities. However, it doesn't disclose important behavioral aspects like rate limits, authentication requirements, error handling, or pagination behavior, leaving significant gaps for a tool with 8 parameters.

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

Conciseness4/5

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

The description is well-structured with clear sections (Best for, Not recommended for, Common mistakes, Prompt Example, Usage Example, Returns) that make it easy to scan. While comprehensive, some sections like the detailed JSON example could be considered verbose. Overall, most content earns its place by providing practical guidance, though it could be slightly more concise.

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 complexity (8 parameters, nested objects, no output schema, no annotations), the description does a good job covering usage context and differentiation from siblings. It explains what the tool returns ('Array of search results with optional scraped content'), which partially compensates for the lack of output schema. However, for a web search tool with extraction capabilities, more behavioral context (like rate limits or error conditions) would improve 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%, so the schema already documents all parameters thoroughly. The description adds minimal parameter semantics beyond what's in the schema - it mentions 'optional extraction' which relates to scrapeOptions, and the usage example shows some parameters in context. This meets the baseline expectation when schema coverage is high, but doesn't provide significant additional value.

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

Purpose5/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 as 'Search the web and optionally extract content from search results,' which is a specific verb+resource combination. It explicitly distinguishes this tool from siblings like scrape, map, and crawl by stating when those alternatives should be used instead, making the differentiation clear and actionable.

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

Usage Guidelines5/5

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

The description provides explicit guidance with dedicated sections: 'Best for' (finding information across multiple websites when the source is unknown), 'Not recommended for' (when the website is known, recommending scrape, map, or crawl), and 'Common mistakes' (avoiding crawl/map for open-ended questions). This comprehensive coverage clearly defines when to use this tool versus alternatives.

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/NYO2008/firecrawl-mcp-server'

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