Skip to main content
Glama
debanshd

Tavily Web Search MCP Server

by debanshd

AI Makerspace: MCP Session Repo for Session 13

This project is a demonstration of the MCP (Model Context Protocol) server, which utilizes the Tavily API for web search capabilities. The server is designed to run in a standard input/output (stdio) transport mode.

Related MCP server: Tavily Web Search MCP Server

Project Overview

The MCP server is set up to handle web search queries using the Tavily API. It is built with the following key components:

  • TavilyClient: A client for interacting with the Tavily API to perform web searches.

Prerequisites

  • Python 3.13 or higher

  • A valid Tavily API key

⚠️NOTE FOR WINDOWS:⚠️

You'll need to install this on the Windows side of your OS.

This will require getting two CLI tool for Powershell, which you can do as follows:

  • winget install astral-sh.uv

  • winget install --id Git.Git -e --source winget

After you have those CLI tools, please open Cursor into Windows.

Then, you can clone the repository using the following command in your Cursor terminal:

git clone https://AI-Maker-Space/AIE7-MCP-Session.git

After that, you can follow from Step 2. below!

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Configure environment variables: Copy the .env.sample to .env and add your Tavily API key:

    TAVILY_API_KEY=your_api_key_here
  3. 🏗️ Add a new tool to your MCP Server 🏗️

Create a new tool in the server.py file, that's it!

Running the MCP Server

To start the MCP server, you will need to add the following to your MCP Profile in Cursor:

NOTE: To get to your MCP config. you can use the Command Pallete (CMD/CTRL+SHIFT+P) and select "View: Open MCP Settings" and replace the contents with the JSON blob below.

{
    "mcpServers":  {
        "mcp-server": {
            "command" : "uv",
            "args" : ["--directory", "/PATH/TO/REPOSITORY", "run", "server.py"]
        }
    }
}

The server will start and listen for commands via standard input/output.

Usage

The server provides a web_search tool that can be used to search the web for information about a given query. This is achieved by calling the web_search function with the desired query string.

Activities:

There are a few activities for this assignment!

🏗️ Activity #1:

Choose an API that you enjoy using - and build an MCP server for it!

🏗️ Activity #2:

Build a simple LangGraph application that interacts with your MCP Server.

You can find details here!

Available Tools

5 tools
read_clipboardA

Read and return the current clipboard text (macOS). Uses pbpaste.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the tool reads clipboard text using `pbpaste` on macOS, which implies platform dependency and read-only behavior. However, it lacks details on error handling, permissions needed, or what happens if clipboard is empty, leaving behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences that efficiently convey purpose, platform, and implementation. Every word adds value, and it is front-loaded with the core action, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, but has an output schema), the description is mostly complete. It covers the action, resource, and platform, but could benefit from mentioning the output format or handling edge cases, though the output schema may mitigate this.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description does not add parameter semantics, but this is appropriate given the lack of parameters, warranting a baseline score above 3 for adequate handling.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Read and return') and resource ('current clipboard text'), with platform specificity ('macOS') and implementation detail ('Uses `pbpaste`'). It distinguishes from sibling 'write_clipboard' by being the read counterpart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'macOS' and the clipboard resource, but does not explicitly state when to use this tool versus alternatives like 'write_clipboard' or other data retrieval methods. It provides clear context but lacks explicit exclusions or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_diceC

Roll the dice with the given notation

ParametersJSON Schema
NameRequiredDescriptionDefault
notationYes
num_rollsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions rolling dice but fails to explain key behaviors: whether results are random, if there are constraints on notation or num_rolls, what the output looks like, or any error handling. This leaves significant gaps for a tool that likely involves randomness and input validation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and directly ties to the input, making it easy to scan and understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity and the presence of an output schema (which should cover return values), the description is somewhat complete for basic use. However, with no annotations and poor parameter semantics, it lacks details on behavior and input handling, making it minimally adequate but with clear gaps for reliable tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It references 'notation' but doesn't explain its format (e.g., standard dice notation like '3d10') or purpose. It ignores 'num_rolls' entirely, leaving users to guess its role. This adds minimal value beyond the schema's basic property names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Roll the dice') and references the input parameter ('with the given notation'), which clarifies the basic purpose. However, it's vague about what 'notation' means (e.g., dice notation like '2d6') and doesn't distinguish this tool from any hypothetical sibling dice tools, though none exist in the provided list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for rolling dice, or comparisons to other tools like random number generators. Without such information, users must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_gmailC

Send an email using Gmail API. Requires GMAIL_USER and GMAIL_APP_PASSWORD environment variables.

ParametersJSON Schema
NameRequiredDescriptionDefault
toYes
subjectYes
bodyYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions authentication requirements (environment variables), which is useful context. However, it lacks details on critical behaviors such as rate limits, error handling, whether emails are sent immediately or queued, or any side effects (e.g., saving drafts). This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences that directly state the tool's purpose and prerequisites. It is front-loaded with the main action, and there is no unnecessary information, making it efficient. However, it could be slightly more structured by explicitly listing parameters or usage examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation tool for sending emails), the absence of annotations, and the presence of an output schema (which may cover return values), the description is partially complete. It includes authentication details but misses behavioral traits and parameter semantics. For a tool with no annotations and 0% schema coverage, it should provide more context to be fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description does not mention any parameters (to, subject, body), offering no semantic information beyond what the bare schema titles imply. Since there are 3 parameters, this lack of detail results in a baseline score of 3, as the description fails to compensate for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Send an email') and the resource ('using Gmail API'), providing a specific verb+resource combination. It distinguishes this tool from siblings like 'read_clipboard' or 'web_search' by focusing on email functionality, though it doesn't explicitly differentiate from non-existent email-related siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions environment variable prerequisites ('Requires GMAIL_USER and GMAIL_APP_PASSWORD'), which provides some usage context. However, it offers no guidance on when to use this tool versus alternatives (e.g., other email-sending methods or tools), nor does it specify exclusions or typical scenarios for its application.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_clipboardA

Write the given text to the clipboard (macOS). Uses pbcopy.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the tool writes text to the clipboard on macOS using `pbcopy`, which implies a mutation operation. However, it lacks details on permissions, error handling, or side effects, offering only basic behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action and resource, followed by implementation details. It consists of two concise sentences with no wasted words, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose, platform, and method, though it could benefit from more behavioral details like error cases or limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that the 'text' parameter is the content to write to the clipboard, which clarifies the parameter's purpose beyond the schema's basic type definition. Since there's only one parameter, this is sufficient for a high score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Write the given text') and target resource ('to the clipboard'), with additional implementation detail ('macOS') and method ('Uses `pbcopy`'). It distinguishes itself from sibling tools like 'read_clipboard' by specifying the write operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'macOS', which suggests this tool is platform-specific. However, it does not explicitly state when to use it versus alternatives (e.g., other clipboard methods or tools) or provide exclusions, leaving some guidance gaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updates
    • First observedread_clipboard
    • First observedroll_dice
    • First observedsend_gmail
    • First observedweb_search
    • First observedwrite_clipboard

TDQS

C2.9/5.0
Disambiguation1/5

The tools have wildly different and unrelated purposes—clipboard operations, dice rolling, email sending, and web searching—with no clear thematic connection, making the set highly ambiguous as a cohesive toolset. An agent would struggle to understand why these specific tools are grouped together, leading to potential misselection based on domain assumptions.

Naming Consistency4/5

The naming follows a consistent verb_noun pattern (e.g., read_clipboard, roll_dice, send_gmail, web_search, write_clipboard), which is predictable and readable. There are minor deviations like 'web_search' using a noun_verb structure instead, but overall the consistency is strong.

Tool Count2/5

With only 5 tools, the count is reasonable in isolation, but it is inappropriate for the server's stated purpose as 'Tavily Web Search MCP Server'—only one tool (web_search) directly relates to web searching, while the others are unrelated utilities, creating a mismatch in scope.

Completeness2/5

For a web search server, there are significant gaps in coverage, such as missing tools for advanced search features, result filtering, or API configuration. The inclusion of unrelated tools like clipboard and email operations further dilutes the domain focus, making the surface incomplete for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/debanshd/AIE7-MCP-Session'

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