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 through the Tavily API to find answers and data from internet sources.

Instructions

Search the web for information about the given query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:14-18 (handler)
    The handler function for the 'web_search' tool. Decorated with @mcp.tool() for registration, it defines the input schema implicitly via type hints (query: str) and docstring, executes the web search using the TavilyClient, and returns the search results as a string.
    @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
  • Initialization of the TavilyClient instance used by the web_search tool handler.
    web_search_client = TavilyClient(os.getenv("TAVILY_API_KEY"))
  • server.py:3-3 (helper)
    Import of the TavilyClient library required for web_search functionality.
    from tavily import TavilyClient
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/julie-berlin/pub-aie7-mcp-session'

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