Skip to main content
Glama
Krieg2065

Firecrawl MCP Server

by Krieg2065

firecrawl_crawl

Crawl multiple web pages from a starting URL with depth control, path filtering, and webhook notifications for asynchronous data collection.

Instructions

Start an asynchronous crawl of multiple pages from a starting URL. Supports depth control, path filtering, and webhook notifications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesStarting URL for the crawl
excludePathsNoURL paths to exclude from crawling
includePathsNoOnly crawl these URL paths
maxDepthNoMaximum link depth to crawl
ignoreSitemapNoSkip sitemap.xml discovery
limitNoMaximum number of pages to crawl
allowBackwardLinksNoAllow crawling links that point to parent directories
allowExternalLinksNoAllow crawling links to external domains
webhookNo
deduplicateSimilarURLsNoRemove similar URLs during crawl
ignoreQueryParametersNoIgnore query parameters when comparing URLs
scrapeOptionsNoOptions for scraping each page

Implementation Reference

  • Defines the input schema and metadata for the firecrawl_crawl tool, including parameters like url, excludePaths, maxDepth, etc.
    const CRAWL_TOOL: Tool = {
      name: 'firecrawl_crawl',
      description:
        'Start an asynchronous crawl of multiple pages from a starting URL. ' +
        'Supports depth control, path filtering, and webhook notifications.',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'Starting URL for the crawl',
          },
          excludePaths: {
            type: 'array',
            items: { type: 'string' },
            description: 'URL paths to exclude from crawling',
          },
          includePaths: {
            type: 'array',
            items: { type: 'string' },
            description: 'Only crawl these URL paths',
          },
          maxDepth: {
            type: 'number',
            description: 'Maximum link depth to crawl',
          },
          ignoreSitemap: {
            type: 'boolean',
            description: 'Skip sitemap.xml discovery',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of pages to crawl',
          },
          allowBackwardLinks: {
            type: 'boolean',
            description: 'Allow crawling links that point to parent directories',
          },
          allowExternalLinks: {
            type: 'boolean',
            description: 'Allow crawling links to external domains',
          },
          webhook: {
            oneOf: [
              {
                type: 'string',
                description: 'Webhook URL to notify when crawl is complete',
              },
              {
                type: 'object',
                properties: {
                  url: {
                    type: 'string',
                    description: 'Webhook URL',
                  },
                  headers: {
                    type: 'object',
                    description: 'Custom headers for webhook requests',
                  },
                },
                required: ['url'],
              },
            ],
          },
          deduplicateSimilarURLs: {
            type: 'boolean',
            description: 'Remove similar URLs during crawl',
          },
          ignoreQueryParameters: {
            type: 'boolean',
            description: 'Ignore query parameters when comparing URLs',
          },
          scrapeOptions: {
            type: 'object',
            properties: {
              formats: {
                type: 'array',
                items: {
                  type: 'string',
                  enum: [
                    'markdown',
                    'html',
                    'rawHtml',
                    'screenshot',
                    'links',
                    'screenshot@fullPage',
                    'extract',
                  ],
                },
              },
              onlyMainContent: {
                type: 'boolean',
              },
              includeTags: {
                type: 'array',
                items: { type: 'string' },
              },
              excludeTags: {
                type: 'array',
                items: { type: 'string' },
              },
              waitFor: {
                type: 'number',
              },
            },
            description: 'Options for scraping each page',
          },
        },
        required: ['url'],
      },
    };
  • src/index.ts:960-973 (registration)
    Registers the CRAWL_TOOL in the list of available tools returned by ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        SCRAPE_TOOL,
        MAP_TOOL,
        CRAWL_TOOL,
        BATCH_SCRAPE_TOOL,
        CHECK_BATCH_STATUS_TOOL,
        CHECK_CRAWL_STATUS_TOOL,
        SEARCH_TOOL,
        EXTRACT_TOOL,
        DEEP_RESEARCH_TOOL,
        GENERATE_LLMSTXT_TOOL,
      ],
    }));
  • The main handler for firecrawl_crawl tool: validates input, calls Firecrawl client.asyncCrawlUrl, handles response and returns job ID.
    case 'firecrawl_crawl': {
      if (!isCrawlOptions(args)) {
        throw new Error('Invalid arguments for firecrawl_crawl');
      }
      const { url, ...options } = args;
      const response = await withRetry(
        async () =>
          // @ts-expect-error Extended API options including origin
          client.asyncCrawlUrl(url, { ...options, origin: 'mcp-server' }),
        'crawl operation'
      );
    
      if (!response.success) {
        throw new Error(response.error);
      }
    
      // Monitor credits for cloud API
      if (!FIRECRAWL_API_URL && hasCredits(response)) {
        await updateCreditUsage(response.creditsUsed);
      }
    
      return {
        content: [
          {
            type: 'text',
            text: trimResponseText(
              `Started crawl for ${url} with job ID: ${response.id}`
            ),
          },
        ],
        isError: false,
      };
    }
  • Type guard function to validate arguments for the crawl tool.
    function isCrawlOptions(args: unknown): args is CrawlParams & { url: string } {
      return (
        typeof args === 'object' &&
        args !== null &&
        'url' in args &&
        typeof (args as { url: unknown }).url === 'string'
      );
    }
Behavior2/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 the tool is 'asynchronous' and supports 'webhook notifications,' which are useful behavioral traits. However, it doesn't address critical aspects like rate limits, authentication requirements, error handling, or what happens when the crawl completes (e.g., where results are stored). For a complex tool with 12 parameters, this leaves significant gaps.

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 a single, well-structured sentence that efficiently conveys the core purpose and key features without unnecessary words. It's front-loaded with the main action and resource, making it easy to understand at a glance.

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 (12 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and some capabilities but lacks details on behavioral traits, return values, or error handling. The high schema coverage helps, but for an asynchronous operation with many options, more context would be beneficial.

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 high at 92%, so the baseline is 3 even without parameter details in the description. The description adds minimal value beyond the schema by mentioning 'depth control, path filtering, and webhook notifications,' which loosely correspond to parameters like maxDepth, includePaths/excludePaths, and webhook, but doesn't provide additional semantic context or usage examples.

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 specific action ('start an asynchronous crawl'), the resource ('multiple pages from a starting URL'), and key capabilities ('depth control, path filtering, and webhook notifications'). It distinguishes itself from siblings like firecrawl_scrape or firecrawl_extract by focusing on multi-page crawling rather than single-page operations.

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 'asynchronous crawl of multiple pages' and mentions capabilities like depth control, which suggests when to use this tool. However, it doesn't explicitly state when to choose this over alternatives like firecrawl_map or firecrawl_batch_scrape, nor does it mention prerequisites or 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/Krieg2065/firecrawl-mcp-server'

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