Skip to main content
Glama
Replicant-Partners

Firecrawl Agent MCP Server

search

Search the web and extract content from multiple sources simultaneously to gather structured data for research and analysis.

Instructions

Search the web and scrape the results. Returns scraped content from multiple search results. Use this for finding and extracting data from multiple sources at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., "best AI tools 2025")
limitNoMaximum number of results to return. Default: 5
formatsNoOutput formats for each result. Default: ["markdown"]

Implementation Reference

  • src/server.ts:183-210 (registration)
    Registers the 'search' tool in the MCP TOOLS array with name, description, and input schema definition.
      {
        name: 'search',
        description:
          'Search the web and scrape the results. Returns scraped content from multiple search results. Use this for finding and extracting data from multiple sources at once.',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: 'Search query (e.g., "best AI tools 2025")',
            },
            limit: {
              type: 'number',
              description: 'Maximum number of results to return. Default: 5',
            },
            formats: {
              type: 'array',
              items: {
                type: 'string',
                enum: ['markdown', 'html', 'rawHtml', 'links'],
              },
              description: 'Output formats for each result. Default: ["markdown"]',
            },
          },
          required: ['query'],
        },
      },
    ];
  • MCP CallTool handler for 'search': extracts parameters, invokes FirecrawlClient.search, handles success/error and returns formatted JSON response.
    case 'search': {
      const { query, limit, formats } = args as {
        query: string;
        limit?: number;
        formats?: ('markdown' | 'html' | 'rawHtml' | 'links')[];
      };
    
      const result = await firecrawl.search({
        query,
        limit,
        formats,
      });
    
      if (!result.success) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${result.error}`,
            },
          ],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                success: true,
                data: result.data,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • FirecrawlClient.search method: performs HTTP POST to /v1/search API endpoint, handles response and errors.
    async search(request: FirecrawlSearchRequest): Promise<FirecrawlSearchResponse> {
      try {
        const response = await fetch(`${this.apiBase}/v1/search`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${this.apiKey}`,
          },
          body: JSON.stringify(request),
        });
    
        const data = await response.json() as any;
    
        if (!response.ok) {
          return {
            success: false,
            error: data.error || `HTTP ${response.status}: ${response.statusText}`,
          };
        }
    
        return {
          success: true,
          data: data.data,
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error',
        };
      }
    }
  • TypeScript interfaces defining input (FirecrawlSearchRequest) and output (FirecrawlSearchResponse) types for the search functionality.
    export interface FirecrawlSearchRequest {
      query: string;
      limit?: number;
      formats?: ('markdown' | 'html' | 'rawHtml' | 'links')[];
    }
    
    export interface FirecrawlSearchResponse {
      success: boolean;
      data?: Array<{
        url: string;
        markdown?: string;
        html?: string;
        rawHtml?: string;
        links?: string[];
        metadata?: Record<string, any>;
      }>;
      error?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'scrapes' results and returns 'scraped content from multiple search results,' which implies data extraction behavior. However, it lacks details on rate limits, authentication needs, error handling, or what 'scraping' entails (e.g., potential blocking, legal considerations). For a tool with no annotations, this is a significant gap in transparency.

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 two sentences, front-loaded with the core purpose and followed by usage guidance. Every sentence earns its place: the first defines the action and output, the second specifies the use case. There's zero waste or redundancy, making it appropriately sized and efficient.

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

Completeness3/5

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

Given the tool's complexity (web search and scraping with 3 parameters), no annotations, and no output schema, the description is moderately complete. It covers the purpose and usage but lacks details on behavioral traits, return values, or error handling. The schema handles parameters well, but overall completeness is adequate with clear gaps for a tool of this nature.

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?

The input schema has 100% description coverage, providing clear details for all parameters (query, limit, formats). The description adds no parameter-specific information beyond what's in the schema. According to the rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description. The description doesn't compensate but doesn't need to, given the schema's completeness.

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 and scrape the results. Returns scraped content from multiple search results.' It specifies the verb ('search' and 'scrape') and resource ('web' and 'search results'), but doesn't explicitly differentiate from its sibling 'scrape' tool, which might have overlapping functionality. The description is specific but lacks sibling comparison.

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

Usage Guidelines4/5

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

The description provides clear usage context: 'Use this for finding and extracting data from multiple sources at once.' This indicates when to use the tool (for multi-source data extraction) but doesn't explicitly state when not to use it or name alternatives like the 'scrape' sibling tool. It offers implied guidance but no explicit exclusions.

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/Replicant-Partners/Firecrawler-MCP'

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