Skip to main content
Glama
neeraj-somani

Tavily Web Search MCP Server

web_search

Search the web to find information and answer questions using real-time internet data and enhanced search capabilities.

Instructions

Search the web for information about the given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:13-17 (handler)
    The main implementation of the web_search tool. It is registered via the @mcp.tool() decorator and uses a TavilyClient instance to perform the web search based on the query and return the search results.
    @mcp.tool() def web_search(query: str) -> str: """Search the web for information about the given query""" search_results = client.get_search_context(query=query) return search_results
  • server.py:13-13 (registration)
    The @mcp.tool() decorator registers the web_search function as an MCP tool.
    @mcp.tool()
  • Initializes the TavilyClient used by the web_search tool.
    client = TavilyClient(os.getenv("TAVILY_API_KEY"))
  • server.py:3-3 (helper)
    Imports the TavilyClient library required for web_search.
    from tavily import TavilyClient

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/neeraj-somani/AIE8-MCP-S13'

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