Skip to main content
Glama
julie-berlin

Tavily Web Search MCP Server

by julie-berlin

web_search

Search the web for information using natural language queries to find answers and data from across the internet.

Instructions

Search the web for information about the given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:14-18 (handler)
    The web_search tool handler: decorated with @mcp.tool() for registration, defines input schema via type hints (query: str), executes web search using TavilyClient, and returns results as str.
    @mcp.tool() def web_search(query: str) -> str: """Search the web for information about the given query""" search_results = web_search_client.get_search_context(query=query) return search_results
  • Helper: Initializes the TavilyClient instance used by the web_search handler, loading API key from environment.
    web_search_client = TavilyClient(os.getenv("TAVILY_API_KEY"))

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/julie-berlin/pub-aie7-mcp-session'

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