Skip to main content
Glama

firecrawl_map

Discover and extract URLs from websites using sitemap.xml or HTML link analysis. Start with a URL to map site structure and find relevant pages.

Instructions

Discover URLs from a starting point. Can use both sitemap.xml and HTML link discovery.

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 executes the firecrawl_map tool by validating input with isMapOptions, destructuring arguments, calling the Firecrawl client's mapUrl method, handling errors, and returning the discovered URLs as text content.
    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); 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: response.links.join('\n') }], isError: false, }; }
  • The Tool object definition including name, description, and detailed inputSchema for validating firecrawl_map parameters.
    const MAP_TOOL: Tool = { name: 'firecrawl_map', description: 'Discover URLs from a starting point. Can use both sitemap.xml and HTML link discovery.', 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'], }, };
  • src/index.ts:863-873 (registration)
    Registration of the firecrawl_map tool (as MAP_TOOL) in the array of available tools served by the ListToolsRequestSchema handler.
    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, ],
  • Helper type guard function used to validate if the provided arguments match the expected MapParams shape for 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/mcma123/firecrawl-mcp-server'

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