Skip to main content
Glama
debanshd

Tavily Web Search MCP Server

by debanshd

send_gmail

Send emails directly from the Tavily Web Search MCP Server using the Gmail API. Configure environment variables to authenticate and compose messages with recipient, subject, and body content.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYes
subjectYes
bodyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:28-64 (handler)
    Implementation of the send_gmail tool handler. Decorated with @mcp.tool() which also registers it. Sends email via Gmail SMTP using smtplib, with input schema defined by function parameters (to: str, subject: str, body: str).
    @mcp.tool()
    def send_gmail(to: str, subject: str, body: str) -> str:
        """Send an email using Gmail API. Requires GMAIL_USER and GMAIL_APP_PASSWORD environment variables."""
        try:
            import smtplib
            from email.mime.text import MIMEText
            from email.mime.multipart import MIMEMultipart
            
            # Get Gmail credentials from environment variables
            gmail_user = os.getenv("GMAIL_USER")
            gmail_password = os.getenv("GMAIL_APP_PASSWORD")
            
            if not gmail_user or not gmail_password:
                return "❌ Gmail credentials not configured. Please set GMAIL_USER and GMAIL_APP_PASSWORD environment variables."
            
            # Create message
            msg = MIMEMultipart()
            msg['From'] = gmail_user
            msg['To'] = to
            msg['Subject'] = subject
            
            # Add body to email
            msg.attach(MIMEText(body, 'plain'))
            
            # Send email
            server = smtplib.SMTP('smtp.gmail.com', 587)
            server.starttls()
            server.login(gmail_user, gmail_password)
            text = msg.as_string()
            server.sendmail(gmail_user, to, text)
            server.quit()
            
            return f"✅ Email sent successfully to {to} with subject: {subject}"
            
        except Exception as e:
            return f"❌ Failed to send email: {str(e)}"
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.

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

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