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(); }

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