Skip to main content
Glama
tavily-ai

Tavily MCP Server

Official
by tavily-ai

tavily-crawl

Crawl websites from a starting URL to extract structured content, controlling depth, breadth, and focus areas for targeted data collection.

Instructions

A powerful web crawler that initiates a structured web crawl starting from a specified base URL. The crawler expands from that point like a graph, following internal links across pages. You can control how deep and wide it goes, and guide it to focus on specific sections of the site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe root URL to begin the crawl
max_depthNoMax depth of the crawl. 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. Instructions specify which types of pages the crawler should return.
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
extract_depthNoAdvanced extraction retrieves more data, including tables and embedded content, with higher success but may increase latencybasic
formatNoThe format of the extracted web page content. markdown returns content in markdown format. text returns plain text and may increase latency.markdown
include_faviconNoWhether to include the favicon URL for each result

Implementation Reference

  • Core handler function that executes the tavily-crawl tool logic by making an API call to the Tavily crawl endpoint.
    async crawl(params: any): Promise<TavilyCrawlResponse> {
      try {
        const response = await this.axiosInstance.post(this.baseURLs.crawl, {
          ...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 definition for the tavily-crawl tool, including parameters like url, max_depth, instructions, etc.
    {
      name: "tavily-crawl",
      description: "A powerful web crawler that initiates a structured web crawl starting from a specified base URL. The crawler expands from that point like a graph, following internal links across pages. You can control how deep and wide it goes, and guide it to focus on specific sections of the site.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "The root URL to begin the crawl"
          },
          max_depth: {
            type: "integer",
            description: "Max depth of the crawl. 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. Instructions specify which types of pages the crawler should return."
          },
          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
          },
          extract_depth: {
            type: "string",
            enum: ["basic", "advanced"],
            description: "Advanced extraction retrieves more data, including tables and embedded content, with higher success but may increase latency",
            default: "basic"
          },
          format: {
            type: "string",
            enum: ["markdown","text"],
            description: "The format of the extracted web page content. markdown returns content in markdown format. text returns plain text and may increase latency.",
            default: "markdown"
          },
          include_favicon: { 
            type: "boolean", 
            description: "Whether to include the favicon URL for each result",
            default: false,
          },
        },
        required: ["url"]
      }
    },
  • Tool dispatch handler case that processes arguments, calls the crawl method, formats the response, and returns MCP content.
    case "tavily-crawl":
      const crawlResponse = await this.crawl({
        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,
        extract_depth: args.extract_depth,
        format: args.format,
        include_favicon: args.include_favicon,
        chunks_per_source: 3,
      });
      return {
        content: [{
          type: "text",
          text: formatCrawlResults(crawlResponse)
        }]
      };
  • Helper function to format the Tavily crawl response into readable text output.
    function formatCrawlResults(response: TavilyCrawlResponse): string {
      const output: string[] = [];
      
      output.push(`Crawl Results:`);
      output.push(`Base URL: ${response.base_url}`);
      
      output.push('\nCrawled Pages:');
      response.results.forEach((page, index) => {
        output.push(`\n[${index + 1}] URL: ${page.url}`);
        if (page.raw_content) {
          // Truncate content if it's too long
          const contentPreview = page.raw_content.length > 200 
            ? page.raw_content.substring(0, 200) + "..." 
            : page.raw_content;
          output.push(`Content: ${contentPreview}`);
        }
        if (page.favicon) {
          output.push(`Favicon: ${page.favicon}`);
        }
      });
      
      return output.join('\n');
    }
  • src/index.ts:735-737 (registration)
    Tool registration in the CLI listTools function.
      name: "tavily-crawl",
      description: "A sophisticated web crawler that systematically explores websites starting from a base URL. Features include configurable depth and breadth limits, domain filtering, path pattern matching, and category-based filtering. Perfect for comprehensive site analysis, content discovery, and structured data collection."
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the crawler 'expands like a graph' and can be controlled for depth/width/focus, but fails to disclose critical behaviors: whether it respects robots.txt, rate limits, authentication needs, error handling, output format details, or what 'process' means for links. This leaves significant gaps for a mutation tool (crawling implies data retrieval).

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 appropriately sized (three sentences) and front-loaded with the core purpose. Each sentence adds value: the first defines the tool, the second explains expansion behavior, and the third outlines controllability. There's no redundant or wasted language, though it could be slightly more structured for clarity.

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 (11 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits (e.g., rate limits, permissions), output format, error handling, and explicit differentiation from siblings. While the schema covers parameters well, the description doesn't compensate for missing annotation and output information, making it inadequate for safe and effective use.

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 fully documents all 11 parameters. The description adds minimal value beyond the schema, only vaguely referencing 'control how deep and wide it goes' and 'guide it to focus on specific sections,' which loosely maps to max_depth, max_breadth, and instructions/select_paths. No additional syntax, format, or interaction details are provided beyond what's in the schema.

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 as 'initiates a structured web crawl starting from a specified base URL' with specific verbs ('crawl', 'expands', 'following internal links'). It distinguishes from sibling tools by focusing on crawling rather than extraction, mapping, or searching. However, it doesn't explicitly contrast with each sibling's specific function.

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 context by mentioning 'guide it to focus on specific sections of the site' and controlling depth/breadth, suggesting when to use this tool for structured exploration. However, it lacks explicit guidance on when to choose this over alternatives like tavily-search or tavily-extract, nor does it mention prerequisites or exclusions.

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