An MCP server that processes Gmail emails with RAG (Retrieval-Augmented Generation) capabilities, indexing email content and attachments, generating summaries, and enabling semantic search across email threads.
This server suffers from critical gaps in tool definitions, security, and error handling. While 12 tools are registered with names and basic descriptions, the implementation reveals significant deficiencies: (1) No input schemas are visible in the provided source code, only tool names and descriptions are shown. Schema files or explicit schema definitions do not appear in mcp_server_simplified.py. (2) Descriptions are present but generic and lack actionable guidance for LLM selection, they state WHAT but rarely WHEN or WHY. (3) Critical security issues: OAuth credentials and tokens are managed via global STATE dict without apparent secret injection patterns; no rate limiting; no audit trails visible. (4) No error handling guidance, tools return strings like 'Error: Gmail service is not available' with no recovery hints. (5) Parameter descriptions are minimal (e.g., 'The authorization code received from Google's OAuth consent screen' for authenticate_gmail.auth_code is adequate, but others like query_email_thread.question lack context on expected input format or length). (6) No output schemas documented, callers don't know what data structure to expect. (7) Destructive operations (delete_email) have no confirmation or dry-run pattern. (8) Monitoring tools (start_email_monitoring, stop_email_monitoring) imply stateful background processes, violating stateless request handling. (9) No pagination documented for list_unread_emails, risking context window exhaustion. The server is STDIO-only, further limiting its production viability.
Authenticates the user with Gmail using OAuth 2.0 flow and stores the access token for future API calls.
Deletes an email message by moving it to trash.
Retrieves the full content of a specific email message by its message ID, including headers, body, and attachment metadata.
Retrieves the concatenated text content of all messages in a specific email thread for context or analysis.
Retrieves a comprehensive summary of an entire email thread from the database.
Lists all unread emails from the user's Gmail inbox.
Marks a specific email message as read by removing the UNREAD label.
No input schemas visible in source code. Tool definitions reference only names, descriptions, and parameter hints, not formal JSON Schema with types, constraints, enums, or patterns.
No output schemas documented. Tools like get_email_content, get_thread_summary, get_thread_history, and list_unread_emails do not specify return data structure. LLMs cannot plan downstream tool calls or extract needed fields without knowing output shape.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 29 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 0 | - | v1 |
Moves an email message to a specific Gmail label, creating the label if it does not exist.
Processes a single email by parsing content, indexing it in the RAG system, generating a summary, and saving metadata to the database. Also downloads and indexes attachments.
Sends a semantic query to the RAG system to retrieve relevant information from a specific email thread using vector similarity search.
Starts a background scheduler that monitors incoming emails at regular intervals and automatically processes them.
Stops the background email monitoring scheduler.
OAuth credentials and tokens stored in global STATE dict without apparent secret injection. Client secrets (credentials.json) and tokens (token.json) are file-based with no vault integration. Authentication state is not isolated per-request, violating stateless protocol design. Secrets may leak into logs via parameter tracing.
Destructive operation (delete_email) lacks confirmation or dry-run pattern. No verification step before permanent deletion. Agents can trigger irreversible data loss without guard rails.
No error handling guidance. Error messages are generic strings ('Error: Gmail service is not available') with no recovery hints, retry classification, or next-step suggestions. LLMs cannot self-correct or determine whether to retry.
Monitoring tools (start_email_monitoring, stop_email_monitoring) imply stateful background scheduler, violating stateless request-response protocol. Each request should be self-contained; background jobs contradict MCP design.
list_unread_emails has no pagination parameters (limit, offset, page_size, next_cursor). No mention of result count limits. Large inboxes risk context window exhaustion and token waste.
Descriptions are present but lack actionable context for LLM selection. Most descriptions state WHAT (e.g., 'Lists all unread emails') but not WHEN to use vs. similar tools, prerequisites, or expected preconditions. Average description length ~60 chars; baseline suggests 194 chars for A+ tools.
Parameter descriptions are minimal or missing actionable constraints. Example: authenticate_gmail.auth_code description states what it is but not format/length/source. query_email_thread.question lacks guidance on query syntax, length limits, or expected coverage.
No rate limiting visible. Monitoring scheduler and potential retry loops could generate hundreds of calls per minute without guards, overwhelming Gmail API quota.
No audit trail or logging for who called which tool and when. Required for compliance and incident response in email handling.