Skip to main content
Glama
0xzapata

Firecrawl MCP Server

firecrawl_map

Discover all indexed URLs on a website by mapping its structure. Ideal for finding specific sections of a site before scraping.

Instructions

Map a website to discover all indexed URLs on the site.

Best for: Discovering URLs on a website before deciding what to scrape; finding specific sections of a website. Not recommended for: When you already know which specific URL you need (use scrape or batch_scrape); when you need the content of the pages (use scrape after mapping). Common mistakes: Using crawl to discover URLs instead of map. Prompt Example: "List all URLs on example.com." Usage Example:

{
  "name": "firecrawl_map",
  "arguments": {
    "url": "https://example.com"
  }
}

Returns: Array of URLs found on the site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesStarting URL for URL discovery
searchNoOptional search term to filter URLs
ignoreSitemapNoSkip sitemap.xml discovery and only use HTML links
sitemapOnlyNoOnly use sitemap.xml for discovery, ignore HTML links
includeSubdomainsNoInclude URLs from subdomains in results
limitNoMaximum number of URLs to return

Implementation Reference

  • src/index.ts:954-966 (registration)
    Registration of MAP_TOOL (firecrawl_map) in the ListToolsRequestSchema handler, making it available for calls.
    // Tool handlers
    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,
      ],
    }));
  • MAP_TOOL definition with inputSchema for firecrawl_map tool. Defines parameters: url (required), search, ignoreSitemap, sitemapOnly, includeSubdomains, limit.
    const MAP_TOOL: Tool = {
      name: 'firecrawl_map',
      description: `
    Map a website to discover all indexed URLs on the site.
    
    **Best for:** Discovering URLs on a website before deciding what to scrape; finding specific sections of a website.
    **Not recommended for:** When you already know which specific URL you need (use scrape or batch_scrape); when you need the content of the pages (use scrape after mapping).
    **Common mistakes:** Using crawl to discover URLs instead of map.
    **Prompt Example:** "List all URLs on example.com."
    **Usage Example:**
    \`\`\`json
    {
      "name": "firecrawl_map",
      "arguments": {
        "url": "https://example.com"
      }
    }
    \`\`\`
    **Returns:** Array of URLs found on the site.
    `,
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'Starting URL for URL discovery',
          },
          search: {
            type: 'string',
            description: 'Optional search term to filter URLs',
          },
          ignoreSitemap: {
            type: 'boolean',
            description: 'Skip sitemap.xml discovery and only use HTML links',
          },
          sitemapOnly: {
            type: 'boolean',
            description: 'Only use sitemap.xml for discovery, ignore HTML links',
          },
          includeSubdomains: {
            type: 'boolean',
            description: 'Include URLs from subdomains in results',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of URLs to return',
          },
        },
        required: ['url'],
      },
    };
  • Handler logic for 'firecrawl_map' case in CallToolRequestSchema. Validates args via isMapOptions, calls client.mapUrl(), and returns links joined by newlines.
    case 'firecrawl_map': {
      if (!isMapOptions(args)) {
        throw new Error('Invalid arguments for firecrawl_map');
      }
      const { url, ...options } = args;
      const response = await client.mapUrl(url, {
        ...options,
        // @ts-expect-error Extended API options including origin
        origin: 'mcp-server',
      });
      if ('error' in response) {
        throw new Error(response.error);
      }
      if (!response.links) {
        throw new Error('No links received from Firecrawl API');
      }
      return {
        content: [
          { type: 'text', text: trimResponseText(response.links.join('\n')) },
        ],
        isError: false,
      };
    }
  • isMapOptions type guard: validates that args is an object with a string 'url' property (MapParams & { url: string }).
    function isMapOptions(args: unknown): args is MapParams & { url: string } {
      return (
        typeof args === 'object' &&
        args !== null &&
        'url' in args &&
        typeof (args as { url: unknown }).url === 'string'
      );
    }
  • trimResponseText utility used in the map handler to trim whitespace from response text.
    function trimResponseText(text: string): string {
      return text.trim();
    }
Behavior4/5

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

Description discloses that tool discovers URLs (not content), returns an array of URLs, and provides usage example. No annotations given, but the description adequately covers the tool's read-only, non-destructive nature and return type.

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?

Description is concise with clear sections (Best for, Not recommended, Common mistakes, Examples, Returns). Each sentence adds value; no wasted words.

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?

With 6 parameters all documented in schema and a simple return type (array of URLs), the description covers the tool's purpose and behavior adequately. Usage example further clarifies invocation.

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 baseline 3. Description does not add significant extra meaning beyond the schema's parameter descriptions, but the usage example demonstrates typical invocation.

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?

Description uses specific verb 'Map' and resource 'website', clearly states outcome 'discover all indexed URLs'. Differentiates from siblings by explicitly mentioning when to use scrape, batch_scrape, or crawl instead.

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?

Explicit 'Best for' and 'Not recommended for' sections provide clear guidance on when to use this tool vs alternatives. Also includes 'Common mistakes' to avoid using crawl for URL discovery.

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

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