Skip to main content
Glama

one_map

Discover URLs from a starting point using sitemap.xml and HTML link discovery to map website 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

  • Core handler function for 'one_map' tool: invokes Firecrawl's mapUrl to discover URLs from a starting point and returns formatted list of links.
    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, }; }
  • Tool schema definition for 'one_map', including input schema for parameters like url, search, limit, etc.
    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:66-73 (registration)
    Registers MAP_TOOL (one_map) in the server's listTools handler response.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_TOOL, EXTRACT_TOOL, SCRAPE_TOOL, MAP_TOOL, ], }));
  • Dispatcher case in CallToolRequest handler that validates args and invokes processMapUrl for 'one_map'.
    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 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' ); }
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/yokingma/one-search-mcp'

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