Skip to main content
Glama
sumitchatterjee13

Tavily Cursor MCP Server

tavily_search

Search the web to retrieve relevant information with URLs, content snippets, and metadata for research, content creation, or question answering.

Instructions

Search the web using Tavily API. Returns relevant search results with URLs, content snippets, and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query
search_depthNoSearch depth - 'basic' for faster results, 'advanced' for more thorough searchbasic
topicNoSearch topic typegeneral
daysNoNumber of days back to search (for news topic)
max_resultsNoMaximum number of results to return
include_imagesNoInclude images in results
include_answerNoInclude AI-generated answer
include_raw_contentNoInclude raw HTML content

Implementation Reference

  • Handler for the 'tavily_search' tool. Invokes TavilyClient.search with parsed arguments and returns the result as formatted text content.
    case "tavily_search": { const result = await tavilyClient.search({ query: args.query, search_depth: args.search_depth || "basic", topic: args.topic || "general", days: args.days || 3, max_results: args.max_results || 5, include_images: args.include_images || false, include_answer: args.include_answer || false, include_raw_content: args.include_raw_content || false, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • index.js:81-134 (registration)
    Registration of the 'tavily_search' tool in the listTools handler, including name, description, and input schema definition.
    { name: "tavily_search", description: "Search the web using Tavily API. Returns relevant search results with URLs, content snippets, and metadata.", inputSchema: { type: "object", properties: { query: { type: "string", description: "The search query", }, search_depth: { type: "string", enum: ["basic", "advanced"], description: "Search depth - 'basic' for faster results, 'advanced' for more thorough search", default: "basic", }, topic: { type: "string", enum: ["general", "news"], description: "Search topic type", default: "general", }, days: { type: "number", description: "Number of days back to search (for news topic)", default: 3, }, max_results: { type: "number", description: "Maximum number of results to return", default: 5, minimum: 1, maximum: 20, }, include_images: { type: "boolean", description: "Include images in results", default: false, }, include_answer: { type: "boolean", description: "Include AI-generated answer", default: false, }, include_raw_content: { type: "boolean", description: "Include raw HTML content", default: false, }, }, required: ["query"], }, },
  • Helper method in TavilyClient class that performs the HTTP POST request to the Tavily search API endpoint.
    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