MCP server for Gmail API with OAuth2 authentication and comprehensive email management
This Gmail MCP server demonstrates solid foundational quality with 20 well-structured tools covering email, label, and filter management. All tools have explicit descriptions (10-170 chars, well within the 10-1024 guideline) and complete JSON Schema definitions with proper type constraints and parameter descriptions. Zod schemas are properly compiled to JSON Schema. However, several patterns remain unimplemented: tool annotations (destructiveHint/readOnlyHint/idempotentHint) are absent, error handling lacks actionable recovery guidance, output schemas are not formally documented, and security gaps exist around rate limiting and audit logging. The naming convention is consistent and action-oriented (send_, delete_, create_, etc.), and parameter naming uses appropriate suffixes (_id, _email for disambiguation). Batch operations and template-based creation show good composition thinking. Most parameter descriptions adequately explain format and constraints, though some could be more explicit about ranges and dependencies.
Permanently deletes multiple emails in batches
Modifies labels for multiple emails in batches
Gets exact email count for a label using Gmail API label metadata (provides total and unread counts)
Creates a new Gmail filter with custom criteria and actions
Creates a filter using a pre-defined template for common scenarios
Creates a new Gmail label
Missing tool annotations (destructiveHint, readOnlyHint, idempotentHint) across all 20 tools. Agents cannot distinguish safe tools from destructive operations without reading full descriptions. delete_email, batch_delete_emails, delete_label, delete_filter should be marked destructive; read_email, search_emails, list_email_labels should be marked readOnly.
Output schemas are not formally documented in the source code. While tools return structured results (visible from implementation context), the evaluator cannot verify response field names, types, and required fields for all 20 tools. For example, send_email's response format is undocumented, does it return messageId, threadId, or both? This forces agents to infer structure.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 63 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 35 | - | v1 |
Permanently deletes an email
Deletes a Gmail filter
Deletes a Gmail label
Downloads an email attachment to a specified location
Draft a new email
Gets details of a specific Gmail filter
Gets an existing label by name or creates it if it doesn't exist
Retrieves all available Gmail labels
Retrieves all Gmail filters
Modifies email labels (move to different folders)
Retrieves the content of a specific email
Searches for emails using Gmail search syntax
Sends a new email
Updates an existing Gmail label
Error handling does not provide actionable recovery guidance. Error responses likely return raw API errors or generic messages without suggesting next steps (e.g., 'Recipient not found. Use search_emails to find valid email addresses.' or 'Label ID invalid. Call list_email_labels() to see available labels.'). This forces agents to guess how to recover.
sendEmail and send_email (or draft_email) lack explicit confirmation/dry-run support for destructive intent. While drafting first is good UX, the pattern should explicitly offer a 'dry_run' flag or confirmation step before send_email executes. This prevents accidental mass-sends.
No explicit rate limiting or timeout configuration visible in tool definitions. Agents could spawn hundreds of batch operations without backoff, overwhelming Gmail API and hitting rate limits. Tools should declare timeout expectations and backoff guidance.
OAuth token and credentials handling not visible in tool definitions. If tokens are stored or passed as parameters, this violates secret-injection pattern. Server-side auth injection must be verified.
count_emails schema allows both labelId and labelName as optional, requiring refinement validation. While Zod schema includes .refine() check, the JSON Schema output may not properly encode this constraint. Parameter description should explicitly state: 'Either labelId or labelName is required; providing both may cause ambiguity.'
search_emails maxResults parameter lacks explicit min/max bounds in description. Zod schema constrains to positive().max(500).default(10), but the input parameter description does not state 'max 500 results' or 'minimum 1'. Agents may attempt invalid values if they only read the description, not the schema.