firecrawl_map
Discover and map website URLs from a starting point using sitemap.xml or HTML link analysis to identify connected pages.
Instructions
Discover URLs from a starting point. Can use both sitemap.xml and HTML link discovery.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Starting URL for URL discovery | |
| search | No | Optional search term to filter URLs | |
| ignoreSitemap | No | Skip sitemap.xml discovery and only use HTML links | |
| sitemapOnly | No | Only use sitemap.xml for discovery, ignore HTML links | |
| includeSubdomains | No | Include URLs from subdomains in results | |
| limit | No | Maximum number of URLs to return |
Implementation Reference
- src/index.ts:1072-1094 (handler)Handler function for 'firecrawl_map' tool. Validates input using isMapOptions, calls Firecrawl client.mapUrl to discover URLs, handles errors, and returns the list of links.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, }; }
- src/index.ts:180-214 (schema)Tool definition including name, description, and detailed input schema for 'firecrawl_map'.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:962-973 (registration)Registers MAP_TOOL (firecrawl_map) in the list of available tools returned by ListToolsRequestSchema handler.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, ], }));
- src/index.ts:692-699 (helper)Type guard helper to validate input arguments for the firecrawl_map tool.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' ); }