Skip to main content
Glama
ashishdevthakur3-max

Firecrawl MCP Server

firecrawl_map

Discover all indexed URLs on a website to identify pages for scraping or locate specific sections before content extraction.

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

  • The handler logic for the 'firecrawl_map' tool, which validates arguments and calls the client.mapUrl method.
    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,
      };
    }
    
    case 'firecrawl_crawl': {
  • src/index.ts:203-220 (registration)
    The definition and registration metadata for the 'firecrawl_map' tool.
    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"
      }
    }
    \`\`\`
  • Type validation function for the input arguments of 'firecrawl_map'.
    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'
      );
    }

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/ashishdevthakur3-max/firecrawl-mcp'

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