Skip to main content
Glama

map

Discover all URLs on a domain to create a sitemap-like list for web crawling and data gathering.

Instructions

Discover all URLs on a domain. Returns a sitemap-like list. Costs 2 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesDomain or URL to map
max_pagesNoMaximum URLs to discover (default: 100)
searchNoFilter URLs matching this keyword

Implementation Reference

  • The handler function for the 'map' tool that constructs the request body and calls the SearchClaw API POST /map endpoint, returning JSON formatted results.
    async ({ url, max_pages, search }) => {
      const body: Record<string, unknown> = { url, max_pages };
      if (search) body.search = search;
      return jsonResult(await apiPost("/map", body));
    }
  • Zod schema defining the input parameters for the 'map' tool: url (required string), max_pages (optional number, default 100), and search (optional string filter).
    {
      url: z.string().describe("Domain or URL to map"),
      max_pages: z.number().optional().default(100).describe("Maximum URLs to discover (default: 100)"),
      search: z.string().optional().describe("Filter URLs matching this keyword"),
    },
  • src/index.ts:166-179 (registration)
    Registration of the 'map' tool with the MCP server using server.tool(), including tool name, description, input schema, and handler function.
    server.tool(
      "map",
      "Discover all URLs on a domain. Returns a sitemap-like list. Costs 2 credits.",
      {
        url: z.string().describe("Domain or URL to map"),
        max_pages: z.number().optional().default(100).describe("Maximum URLs to discover (default: 100)"),
        search: z.string().optional().describe("Filter URLs matching this keyword"),
      },
      async ({ url, max_pages, search }) => {
        const body: Record<string, unknown> = { url, max_pages };
        if (search) body.search = search;
        return jsonResult(await apiPost("/map", body));
      }
    );
  • Helper function apiPost() that makes HTTP POST requests to the SearchClaw API with timeout handling and error management.
    async function apiPost(path: string, body: Record<string, unknown>) {
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 30000);
      try {
        const response = await fetch(`${API_BASE}${path}`, {
          method: "POST",
          headers: { ...headers, "Content-Type": "application/json" },
          body: JSON.stringify(body),
          signal: controller.signal,
        });
        if (!response.ok) {
          const text = await response.text();
          throw new Error(`SearchClaw API error ${response.status}: ${text}`);
        }
        return response.json();
      } finally {
        clearTimeout(timeout);
      }
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds value by disclosing cost ('Costs 2 credits') and output format ('Returns a sitemap-like list'), which are not covered by the input schema. However, it does not mention rate limits, authentication needs, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with three concise sentences that each add value: stating the purpose, output, and cost. There is no wasted text, and it efficiently communicates essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is fairly complete. It covers purpose, output, and cost, but could improve by addressing error cases or providing more context on when to use versus siblings. The lack of an output schema means the description should ideally explain return values more thoroughly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters. The description does not add any parameter-specific details beyond what the schema provides, such as examples or constraints, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('discover all URLs') and resource ('on a domain'), and distinguishes it from siblings like 'crawl' or 'search' by focusing on sitemap-like discovery rather than content extraction or query-based searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for URL discovery on domains, but does not explicitly state when to use this tool versus alternatives like 'crawl' or 'search'. It provides some context (sitemap-like list) but lacks clear exclusions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/CSteenkamp/searchclaw-mcp'

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