Skip to main content
Glama
mcma123

Firecrawl MCP Server

by mcma123

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

  • The handler function for the 'firecrawl_crawl' tool. Validates arguments using isCrawlOptions, calls client.asyncCrawlUrl with retry logic, handles response, monitors credits, and returns the 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 () => client.asyncCrawlUrl(url, options),
        '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: `Started crawl for ${url} with job ID: ${response.id}`,
          },
        ],
        isError: false,
      };
    }
  • Tool schema definition for 'firecrawl_crawl' including inputSchema with all parameters like url, excludePaths, maxDepth, webhook, 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:862-874 (registration)
    Registration of all tools including CRAWL_TOOL in the ListToolsRequestSchema handler.
    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,
      ],
    }));
  • Type guard helper function to validate arguments for the firecrawl_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 full burden for behavioral disclosure. It mentions the tool is 'asynchronous' and supports webhook notifications, which is helpful. However, it doesn't cover critical aspects like rate limits, authentication needs, error handling, what happens if the crawl fails, or how results are returned (since there's no output schema). For a complex 12-parameter tool with no annotations, 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 communicates the core purpose and key features. Every word earns its place—there's no redundancy or unnecessary elaboration.

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

Completeness2/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 annotations, no output schema), the description is incomplete. It doesn't explain what the crawl produces (e.g., URLs, content, status), how to retrieve results, error conditions, or performance implications. While concise, it lacks the depth needed for such a multifaceted tool.

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 schema already documents most parameters well. The description adds some context by mentioning 'depth control' (relates to maxDepth), 'path filtering' (relates to includePaths/excludePaths), and 'webhook notifications' (relates to webhook), but doesn't provide additional syntax or format details beyond what the schema offers. Baseline 3 is appropriate given the strong schema coverage.

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 action ('start an asynchronous crawl'), the resource ('multiple pages from a starting URL'), and distinguishes it from siblings by specifying it's for crawling (vs. scraping, extracting, mapping, etc.). It's specific about being asynchronous and handling multiple pages.

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 features like 'depth control, path filtering, and webhook notifications,' suggesting when this tool might be appropriate. However, it doesn't explicitly state when to use this vs. alternatives like firecrawl_scrape or firecrawl_map, 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/mcma123/firecrawl-mcp-server'

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