Skip to main content
Glama
fatwang2

Search1API MCP Server

sitemap

Extract all related links from a URL to uncover its structure and find interconnected pages.

Instructions

Get all related links from a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to get sitemap

Implementation Reference

  • The main handler function for the sitemap tool. Validates arguments via isValidSitemapArgs, makes an API request to the SITEMAP endpoint, and returns the links as JSON. On error, returns an error message.
    export async function handleSitemap(args: unknown, apiKey?: string) {
      if (!isValidSitemapArgs(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid sitemap arguments"
        );
      }
    
      try {
        const response = await makeRequest<SitemapResponse>(
          API_CONFIG.ENDPOINTS.SITEMAP,
          args,
          apiKey
        );
        
        return {
          content: [{
            type: "text",
            mimeType: "application/json",
            text: JSON.stringify(response.links, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            mimeType: "text/plain",
            text: `Sitemap API error: ${formatError(error)}`
          }],
          isError: true
        };
      }
    }
  • SitemapResponse interface defining the API response shape (links: string[]).
    export interface SitemapResponse {
      links: string[];
    }
  • SitemapArgs interface defining input arguments (url: string).
    export interface SitemapArgs {
      url: string;
    }
  • Type guard function isValidSitemapArgs that validates the url argument is a non-empty string.
    export function isValidSitemapArgs(args: unknown): args is SitemapArgs {
      if (typeof args !== 'object' || args === null) {
        return false;
      }
    
      const { url } = args as SitemapArgs;
    
      if (typeof url !== 'string' || url.trim().length === 0) {
        return false;
      }
    
      return true;
  • Tool definition registration: SITEMAP_TOOL with name 'sitemap', description, and inputSchema requiring a 'url' string. Exported in ALL_TOOLS array at line 185.
    export const SITEMAP_TOOL: Tool = {
      name: "sitemap",
      description: "Get all related links from a URL",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "URL to get sitemap"
          }
        },
        required: ["url"]
      }
    };
Behavior2/5

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

No annotations provided, so description must fully disclose behavior. It only says 'Get all related links' without specifying scope, format, or potential side effects (e.g., rate limits, dynamic content handling).

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

Conciseness3/5

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

Single sentence with no wasted words, but it is so brief that it lacks sufficient detail—under-specified rather than efficient.

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

Completeness2/5

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

Given no annotations, no output schema, and minimal parameter info, the description fails to provide enough context for correct usage. Missing return value format, limitations, and appropriate usage scenarios.

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

Parameters2/5

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

Schema coverage is 100% with only one parameter described as 'URL to get sitemap'. Tool description adds no additional meaning beyond the schema's own description; no extra constraints, examples, or context.

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

Purpose3/5

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

Description uses a specific verb 'Get' and resource 'related links from a URL', but 'related links' is vague—does it mean all links on the page, or sitemap XML links? Lacks sharp distinction from siblings.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like 'crawl' or 'search'. No explicit when-to or when-not-to information.

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/fatwang2/search1api-mcp'

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