Skip to main content
Glama
sumitchatterjee13

Tavily Cursor MCP Server

tavily_search_context

Generate search results optimized for RAG context by providing relevant web content based on your query, with adjustable depth and result limits.

Instructions

Generate context for RAG applications. Returns search results optimized for context generation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query
search_depthNoSearch depthbasic
max_resultsNoMaximum number of results

Implementation Reference

  • Handler implementation for the 'tavily_search_context' tool. Executes a Tavily search with query, optional search_depth and max_results, forces include_raw_content: true, and returns the JSON-stringified result.
    case "tavily_search_context": {
      const result = await tavilyClient.search({
        query: args.query,
        search_depth: args.search_depth || "basic",
        max_results: args.max_results || 5,
        include_raw_content: true,
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • index.js:174-199 (registration)
    Tool registration in the ListTools response, including name, description, and input schema definition for 'tavily_search_context'.
    {
      name: "tavily_search_context",
      description:
        "Generate context for RAG applications. Returns search results optimized for context generation.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "The search query",
          },
          search_depth: {
            type: "string",
            enum: ["basic", "advanced"],
            description: "Search depth",
            default: "basic",
          },
          max_results: {
            type: "number",
            description: "Maximum number of results",
            default: 5,
          },
        },
        required: ["query"],
      },
    },
  • TavilyClient.search helper method that performs the actual API call to Tavily's search endpoint, used by the tavily_search_context handler.
    async search(params) {
      const response = await fetch(`${this.baseUrl}/search`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          api_key: this.apiKey,
          ...params,
        }),
      });
    
      if (!response.ok) {
        throw new Error(`Tavily API error: ${response.statusText}`);
      }
    
      return await response.json();
    }
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 states the tool returns 'search results optimized for context generation,' which implies a read-only operation focused on retrieval, but lacks details on permissions, rate limits, error handling, or the format of returned results. This is a significant gap for a tool with behavioral implications.

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 highly concise and front-loaded, consisting of two clear sentences that directly state the tool's purpose and output. There is no wasted language or redundancy, making it efficient and easy to parse.

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 (involving search and context generation), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'optimized for context generation' entails, how results differ from other search tools, or what the return format looks like, leaving gaps for effective agent 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?

The description adds no parameter-specific information beyond what the input schema provides. Since schema description coverage is 100%, the schema already documents all parameters (query, search_depth, max_results) with descriptions and defaults. The description doesn't compensate with additional context, so it meets the baseline of 3.

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: 'Generate context for RAG applications' and 'Returns search results optimized for context generation.' It specifies the verb ('Generate'), resource ('context'), and optimization goal ('for RAG applications'), but doesn't explicitly differentiate from sibling tools like tavily_search or tavily_search_qna, which likely serve similar search-related purposes.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions the tool is 'optimized for context generation,' but doesn't specify scenarios where this is preferred over other search tools like tavily_search or tavily_extract, nor does it outline any prerequisites or exclusions for usage.

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

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