Skip to main content
Glama
tavily-ai

Tavily MCP Server

Official
by tavily-ai

tavily-map

Analyze website structure by mapping URLs to discover content organization, navigation paths, and site architecture for audits and content discovery.

Instructions

A powerful web mapping tool that creates a structured map of website URLs, allowing you to discover and analyze site structure, content organization, and navigation paths. Perfect for site audits, content discovery, and understanding website architecture.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe root URL to begin the mapping
max_depthNoMax depth of the mapping. Defines how far from the base URL the crawler can explore
max_breadthNoMax number of links to follow per level of the tree (i.e., per page)
limitNoTotal number of links the crawler will process before stopping
instructionsNoNatural language instructions for the crawler
select_pathsNoRegex patterns to select only URLs with specific path patterns (e.g., /docs/.*, /api/v1.*)
select_domainsNoRegex patterns to restrict crawling to specific domains or subdomains (e.g., ^docs\.example\.com$)
allow_externalNoWhether to return external links in the final response

Implementation Reference

  • src/index.ts:355-407 (registration)
    Registers the tavily-map tool including its name, description, and detailed input schema in the ListTools response.
    {
      name: "tavily-map",
      description: "A powerful web mapping tool that creates a structured map of website URLs, allowing you to discover and analyze site structure, content organization, and navigation paths. Perfect for site audits, content discovery, and understanding website architecture.",
      inputSchema: {
        type: "object",
        properties: {
          url: { 
            type: "string", 
            description: "The root URL to begin the mapping"
          },
          max_depth: {
            type: "integer",
            description: "Max depth of the mapping. Defines how far from the base URL the crawler can explore",
            default: 1,
            minimum: 1
          },
          max_breadth: {
            type: "integer",
            description: "Max number of links to follow per level of the tree (i.e., per page)",
            default: 20,
            minimum: 1
          },
          limit: {
            type: "integer",
            description: "Total number of links the crawler will process before stopping",
            default: 50,
            minimum: 1
          },
          instructions: {
            type: "string",
            description: "Natural language instructions for the crawler"
          },
          select_paths: {
            type: "array",
            items: { type: "string" },
            description: "Regex patterns to select only URLs with specific path patterns (e.g., /docs/.*, /api/v1.*)",
            default: []
          },
          select_domains: {
            type: "array",
            items: { type: "string" },
            description: "Regex patterns to restrict crawling to specific domains or subdomains (e.g., ^docs\\.example\\.com$)",
            default: []
          },
          allow_external: {
            type: "boolean",
            description: "Whether to return external links in the final response",
            default: true
          }
        },
        required: ["url"]
      }
    },
  • Main handler for tavily-map tool calls: extracts parameters, invokes the map method, formats response, and returns tool output.
    case "tavily-map":
      const mapResponse = await this.map({
        url: args.url,
        max_depth: args.max_depth,
        max_breadth: args.max_breadth,
        limit: args.limit,
        instructions: args.instructions,
        select_paths: Array.isArray(args.select_paths) ? args.select_paths : [],
        select_domains: Array.isArray(args.select_domains) ? args.select_domains : [],
        allow_external: args.allow_external
      });
      return {
        content: [{
          type: "text",
          text: formatMapResults(mapResponse)
        }]
      };
  • Core implementation: sends HTTP POST to Tavily map API endpoint with parameters and handles API errors.
    async map(params: any): Promise<TavilyMapResponse> {
      try {
        const response = await this.axiosInstance.post(this.baseURLs.map, {
          ...params,
          api_key: API_KEY
        });
        return response.data;
      } catch (error: any) {
        if (error.response?.status === 401) {
          throw new Error('Invalid API key');
        } else if (error.response?.status === 429) {
          throw new Error('Usage limit exceeded');
        }
        throw error;
      }
    }
  • TypeScript interface defining the expected response structure from Tavily map API.
    interface TavilyMapResponse {
      base_url: string;
      results: string[];
      response_time: number;
    }
  • Utility function to format the map API response into readable text output for the tool.
    function formatMapResults(response: TavilyMapResponse): string {
      const output: string[] = [];
      
      output.push(`Site Map Results:`);
      output.push(`Base URL: ${response.base_url}`);
      
      output.push('\nMapped Pages:');
      response.results.forEach((page, index) => {
        output.push(`\n[${index + 1}] URL: ${page}`);
      });
      
      return output.join('\n');
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool 'creates a structured map' and is 'powerful,' it does not disclose critical behavioral traits such as rate limits, authentication needs, potential for destructive actions, or what the output looks like. This leaves significant gaps for an AI agent to understand how the tool behaves in practice.

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 the first sentence clearly stating the core functionality. Every sentence adds value by elaborating on use cases without redundancy. It efficiently communicates the tool's purpose and applications in just two sentences.

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

Completeness3/5

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

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is incomplete. It adequately explains the purpose and usage context but lacks details on behavioral aspects and output format, which are crucial for an AI agent to invoke the tool correctly. The description does not fully compensate for the absence of annotations and output schema.

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?

The input schema has 100% description coverage, so the schema already documents all 8 parameters thoroughly. The description does not add any specific parameter semantics beyond what the schema provides, such as explaining how parameters interact or providing usage examples. With high schema coverage, the baseline score of 3 is appropriate.

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 ('creates a structured map of website URLs') and resources ('website URLs'), and distinguishes it from sibling tools by focusing on mapping site structure rather than crawling, extracting, or searching. It explicitly mentions use cases like site audits and understanding website architecture.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Perfect for site audits, content discovery, and understanding website architecture'), but it does not explicitly mention when not to use it or name alternatives like 'tavily-crawl' for different purposes. The guidance is helpful but lacks explicit exclusions or sibling tool comparisons.

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/tavily-ai/tavily-mcp'

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