Skip to main content
Glama

tavily-extract

Extract and process raw web content from URLs for data collection, content analysis, and research tasks with configurable depth and image options.

Instructions

A powerful web content extraction tool that retrieves and processes raw content from specified URLs, ideal for data collection, content analysis, and research tasks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYesList of URLs to extract content from
extract_depthNoDepth of extraction - 'basic' or 'advanced', if usrls are linkedin use 'advanced' or if explicitly told to use advancedbasic
include_imagesNoInclude a list of images extracted from the urls in the response

Implementation Reference

  • Core handler function for the 'tavily-extract' tool. Makes a POST request to the Tavily extract API endpoint using the provided parameters (urls, extract_depth, include_images), handles API errors, and returns the response data.
    async extract(params: any): Promise<TavilyResponse> {
      try {
        const response = await this.axiosInstance.post(this.baseURLs.extract, {
          ...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-extract' tool, defining parameters: urls (required array of strings), extract_depth (enum basic/advanced, default basic), include_images (boolean, default false).
    inputSchema: {
      type: "object",
      properties: {
        urls: { 
          type: "array",
          items: { type: "string" },
          description: "List of URLs to extract content from"
        },
        extract_depth: { 
          type: "string",
          enum: ["basic","advanced"],
          description: "Depth of extraction - 'basic' or 'advanced', if usrls are linkedin use 'advanced' or if explicitly told to use advanced",
          default: "basic"
        },
        include_images: { 
          type: "boolean", 
          description: "Include a list of images extracted from the urls in the response",
          default: false,
        }
      },
      required: ["urls"]
    }
  • src/index.ts:171-196 (registration)
    Registration of the 'tavily-extract' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "tavily-extract",
      description: "A powerful web content extraction tool that retrieves and processes raw content from specified URLs, ideal for data collection, content analysis, and research tasks.",
      inputSchema: {
        type: "object",
        properties: {
          urls: { 
            type: "array",
            items: { type: "string" },
            description: "List of URLs to extract content from"
          },
          extract_depth: { 
            type: "string",
            enum: ["basic","advanced"],
            description: "Depth of extraction - 'basic' or 'advanced', if usrls are linkedin use 'advanced' or if explicitly told to use advanced",
            default: "basic"
          },
          include_images: { 
            type: "boolean", 
            description: "Include a list of images extracted from the urls in the response",
            default: false,
          }
        },
        required: ["urls"]
      }
    },
  • Dispatch logic in the CallToolRequestSchema handler that invokes the extract method when 'tavily-extract' is called.
    case "tavily-extract":
      response = await this.extract({
        urls: args.urls,
        extract_depth: args.extract_depth,
        include_images: args.include_images
      });
      break;
  • TypeScript interface defining the structure of the Tavily API response used by the tavily-extract tool.
    interface TavilyResponse {
      // Response structure from Tavily API
      query: string;
      follow_up_questions?: Array<string>;
      answer?: string;
      images?: Array<string | {
        url: string;
        description?: string;
      }>;
      results: Array<{
        title: string;
        url: string;
        content: string;
        score: number;
        published_date?: string;
        raw_content?: string;
      }>;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'retrieves and processes raw content' but lacks details on rate limits, authentication needs, error handling, or what 'processes' entails (e.g., cleaning, formatting). This is a significant gap for a web extraction tool with no structured safety hints.

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 a single, efficient sentence that front-loads the core purpose and adds context without waste. Every phrase ('powerful web content extraction tool', 'ideal for...') contributes meaningfully to understanding the tool's role.

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 no annotations and no output schema, the description is moderately complete but lacks behavioral details (e.g., rate limits, errors) and output specifics. For a 3-parameter tool with 100% schema coverage, it adequately covers purpose but falls short on operational context.

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 parameters. The description adds no specific parameter semantics beyond what's in the schema, such as explaining 'extract_depth' implications or 'include_images' output format. Baseline 3 is appropriate as the schema does the heavy lifting.

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: 'retrieves and processes raw content from specified URLs' with specific verbs and resources. It distinguishes from the sibling 'tavily-search' by focusing on extraction rather than searching, though the distinction could be more explicit.

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 ('data collection, content analysis, and research tasks') but does not explicitly state when to use this tool versus 'tavily-search' or provide any exclusions. The input schema hints at usage for LinkedIn with 'advanced' extraction, but this is not in the description itself.

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

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