Skip to main content
Glama

one_map

Discover and extract URLs from a starting point using sitemap.xml or HTML link discovery. Filter results by search terms, subdomains, and limits to streamline web data collection.

Instructions

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

Input Schema

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

Implementation Reference

  • The main handler function that executes the 'one_map' tool logic by calling firecrawl.mapUrl, processing the response, and returning formatted content.
    async function processMapUrl(url: string, args: MapParams) { const res = await firecrawl.mapUrl(url, { ...args, }); if ('error' in res) { throw new Error(`Failed to map: ${res.error}`); } if (!res.links) { throw new Error(`No links found from: ${url}`); } return { content: [ { type: 'text', text: res.links.join('\n').trim(), }, ], result: res.links, success: true, }; }
  • Defines the tool metadata, name, description, and input schema for 'one_map'.
    export const MAP_TOOL: Tool = { name: 'one_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:179-206 (registration)
    Switch case in the main tool dispatcher that handles 'one_map' tool calls by validating args and invoking the processMapUrl handler.
    case 'one_map': { if (!checkMapArgs(args)) { throw new Error(`Invalid arguments for tool: [${name}]`); } try { const { content, success, result } = await processMapUrl(args.url, args); return { content, result, success, }; } catch (error) { server.sendLoggingMessage({ level: 'error', data: `[${new Date().toISOString()}] Error mapping: ${error}`, }); const msg = error instanceof Error ? error.message : String(error); return { success: false, content: [ { type: 'text', text: msg, }, ], }; } }
  • Helper function to validate input arguments for the 'one_map' tool.
    function checkMapArgs(args: unknown): args is MapParams & { url: string } { return ( typeof args === 'object' && args !== null && 'url' in args && typeof args.url === 'string' ); }

Other Tools

Related 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/yokingma/one-search-mcp'

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