Skip to main content
Glama
Jeetanshu18

Tavily MCP Server

by Jeetanshu18

tavily-map

Create structured website maps to analyze site structure, discover content, and audit navigation paths for better understanding of web architecture.

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 select crawling to specific domains or subdomains (e.g., ^docs\.example\.com$)
allow_externalNoWhether to allow following links that go to external domains
categoriesNoFilter URLs using predefined categories like documentation, blog, api, etc

Implementation Reference

  • Core implementation of the 'tavily-map' tool handler. Posts parameters to the Tavily map API endpoint ('https://api.tavily.com/map'), handles authentication and rate limit errors, and returns the API response containing the site map.
    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;
      }
    }
  • Input schema for the 'tavily-map' tool, defining parameters such as url (required), max_depth, max_breadth, limit, instructions, filtering options, and categories.
    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 select crawling to specific domains or subdomains (e.g., ^docs\\.example\\.com$)",
          default: []
        },
        allow_external: {
          type: "boolean",
          description: "Whether to allow following links that go to external domains",
          default: false
        },
        categories: {
          type: "array",
          items: { 
            type: "string",
            enum: ["Careers", "Blog", "Documentation", "About", "Pricing", "Community", "Developers", "Contact", "Media"]
          },
          description: "Filter URLs using predefined categories like documentation, blog, api, etc",
          default: []
        }
      },
      required: ["url"]
  • src/index.ts:284-345 (registration)
    Registration of the 'tavily-map' tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
    {
      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 select crawling to specific domains or subdomains (e.g., ^docs\\.example\\.com$)",
            default: []
          },
          allow_external: {
            type: "boolean",
            description: "Whether to allow following links that go to external domains",
            default: false
          },
          categories: {
            type: "array",
            items: { 
              type: "string",
              enum: ["Careers", "Blog", "Documentation", "About", "Pricing", "Community", "Developers", "Contact", "Media"]
            },
            description: "Filter URLs using predefined categories like documentation, blog, api, etc",
            default: []
          }
        },
        required: ["url"]
      }
    },
  • Dispatch handler case for 'tavily-map' in the CallToolRequestSchema. Parses arguments, calls the map method, formats the result, and returns the tool response.
    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,
        categories: Array.isArray(args.categories) ? args.categories : []
      });
      return {
        content: [{
          type: "text",
          text: formatMapResults(mapResponse)
        }]
      };
  • Helper function to format the Tavily map API response into a human-readable string listing the base URL and mapped page URLs.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'creates a structured map' and allows 'discover and analyze,' but lacks critical details: it doesn't specify whether this is a read-only operation, potential rate limits, authentication requirements, output format, or error handling. For a complex web crawling tool with 9 parameters, this leaves significant behavioral gaps unaddressed.

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

Conciseness4/5

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

The description is efficiently structured in two sentences: the first defines the core functionality, and the second lists key use cases. Every phrase adds value without redundancy. While it could potentially benefit from more behavioral details given the tool's complexity, what's present is well-organized and front-loaded with the primary purpose.

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 the tool's complexity (9 parameters, web crawling functionality), lack of annotations, and absence of an output schema, the description is insufficiently complete. It doesn't address critical aspects like what the structured map output looks like, performance characteristics, error conditions, or how it differs from sibling tools. For a tool with this many configuration options and no structured safety hints, more comprehensive guidance is needed.

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%, meaning all parameters are documented in the schema itself. The description adds no specific parameter information beyond what's already in the schema descriptions (e.g., it doesn't explain parameter interactions or provide examples). However, it does contextualize the overall purpose ('structured map of website URLs') which helps interpret why parameters like max_depth and categories matter, meeting the baseline expectation when schema coverage is complete.

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

Purpose4/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: 'creates a structured map of website URLs' for 'discover and analyze site structure, content organization, and navigation paths.' It specifies the verb (creates/maps) and resource (website URLs) with concrete use cases like site audits and content discovery. However, it doesn't explicitly differentiate from sibling tools like tavily-crawl or tavily-extract, which likely have overlapping web analysis functions.

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 contexts ('Perfect for site audits, content discovery, and understanding website architecture') but doesn't provide explicit guidance on when to use this tool versus alternatives like tavily-crawl or tavily-extract. There's no mention of prerequisites, exclusions, or comparative scenarios with sibling tools, leaving the agent to infer appropriate usage from the described functionality alone.

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

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