An MCP server that provides tools to interact with Gmail, including searching threads, fetching email bodies, extracting attachments, and composing emails with AI assistance.
This Gmail MCP server has significant quality gaps across naming, descriptions, schemas, and error handling. While tool names follow verb_noun conventions reasonably well, parameter schemas are incomplete or inferred rather than explicitly visible in the source. Descriptions exist but are generic without specificity on when to use each tool vs. alternatives. No input validation rules, enums, or constraints are documented. Error handling is minimal, no recovery guidance, no classification of retryable vs. fatal errors. Security concerns: the authorize tool exposes OAuth flow but token management is not clearly governed by MCP patterns. The code sample is incomplete (main.go cuts off mid-function), making full schema verification impossible. Per-tool scores reflect visible documentation only; inferred tools are capped at 50.
Initiates OAuth authorization flow for Gmail API access. Returns an HTML page with a link to Google's authorization endpoint.
Composes a new email as a draft or sends it directly. Supports plain text and HTML content, recipient lists (to, cc, bcc), and attachment inclusion.
Composes an email using AI assistance. Takes a prompt describing the desired email content and uses OpenAI to generate the email based on the user's style guide, then returns it as a draft or sends it.
Extracts text content from an email attachment by filename. Safely retrieves attachment data and converts to text based on MIME type (supports PDF, DOCX, and text formats).
Fetches full email content for multiple threads including subject, sender, full body text (limited to 8000 characters), attachment information, and existing drafts.
Retrieves the user's personal email style guide which provides guidelines for email composition such as tone, formatting, and language preferences.
Input schemas are inferred from the provided JSON snippets in the repo description, not explicitly verified in the visible source code. main.go is truncated mid-function, preventing full validation of schema registration. Tools using mark3labs/mcp-go should explicitly call server.AddTool() with full JSON Schema definitions visible in code.
No enum constraints on parameters. 'isDraft' is boolean, but parameters like 'query' (search_threads) and 'body' (compose_email) lack validation rules, format constraints, or length limits. LLMs will pass arbitrary strings without guidance.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 44 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 30 | - | v1 |
Retrieves existing draft messages for a specific email thread. Returns draft metadata including draft ID, from address, and subject.
Searches Gmail threads based on a query and returns matching thread metadata including subject, sender, snippet, message count, attachments, and existing drafts.
Descriptions lack WHEN to use guidance. 'search_threads' vs 'fetch_email_bodies', when should an agent choose one over the other? 'search_threads' returns metadata; 'fetch_email_bodies' gets full content. This distinction is NOT stated. Similarly, 'compose_email' vs 'compose_email_with_ai', no guidance on when AI assistance is preferred.
No error handling guidance. If 'extract_attachment_by_filename' fails, what should the agent do next? Try a different filename? Call a discovery tool? Return value shows error path ('return mcp.NewToolResultError(...)', line visible) but no context on recovery steps or error classification (retryable vs. fatal).
Output schemas NOT documented. What does 'search_threads' return? Thread IDs, subjects, senders, snippet text, attachment counts? The description says it returns 'thread metadata' but no structured schema is visible. Agents cannot chain calls without knowing field names (e.g., 'threadIds' for fetch_email_bodies).
OAuth token exposure risk. 'authorize' tool initiates OAuth and saves token to local file (tokenFile = getAppFilePath('token.json')). Tokens are NOT listed as secret parameters, but the tool's description does not warn that tokens must never be echoed to the user. The response HTML says 'You may close this window', but no guidance on credential safety for logged agents.
'compose_email' with isDraft=false sends immediately with no confirmation. Agents make mistakes, an LLM could misinterpret a user request and send a critical email. No dry-run, no confirmation, no undo. Irreversible operations need guards.
'get_style_guide' returns a file path (styleGuideFile = getAppFilePath('personal-email-style-guide.md')), but the tool definition shows empty input {}. How is the style guide content delivered to the agent? As plain text? As base64? As a URL? Not documented.
No rate limiting or timeout guards visible. Agents looping on 'search_threads' or 'compose_email_with_ai' could trigger hundreds of API calls to Gmail and OpenAI without bounds, burning quota and money.
Parameter descriptions are minimal. 'threadIds' is described as 'Array of thread IDs to fetch full email bodies for', but what format? Gmail's thread ID is a decimal string like '1234567890abcdef' or a long integer? What if a thread ID is invalid? No guidance.