Skip to main content
Glama
inesaranab

Tavily Web Search MCP Server

by inesaranab

web_search

Perform web searches to retrieve information from the internet through natural language queries using the Tavily API.

Instructions

Search the web for information about the given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:16-20 (handler)
    The web_search tool handler implementation. It is registered using the @mcp.tool() decorator from FastMCP, takes a query string, uses a TavilyClient instance to fetch search context, and returns the results as a string. The function signature and docstring define the implicit schema.
    @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
  • Initialization of the TavilyClient instance referenced in the web_search handler for performing web searches.
    client = TavilyClient(os.getenv("TAVILY_API_KEY"))
  • server.py:3-3 (helper)
    Import of TavilyClient library used by the web_search tool.
    from tavily import TavilyClient

Tool Definition Quality

Score is being calculated. Check back soon.

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/inesaranab/MCP'

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