Skip to main content
Glama
inesaranab

Tavily Web Search MCP Server

by inesaranab

web_search

Search the web to find information and answers for any query, retrieving relevant results from across the internet.

Instructions

Search the web for information about the given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:16-20 (handler)
    The web_search tool handler function. It is registered via the @mcp.tool() decorator, defines the input schema via type hints (query: str), and implements the logic using a TavilyClient instance to perform the web search.
    @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 global TavilyClient instance used by the web_search tool.
    client = TavilyClient(os.getenv("TAVILY_API_KEY"))
  • server.py:3-3 (helper)
    Import of TavilyClient library required for the web_search tool implementation.
    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/inesaranab/MCP'

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