Gmail attachment access via MCP. Use list_attachments to discover emails, download_attachment to save files, extract_attachment to get text content.
Three tools with clear verb-noun naming (list_, download_, extract_) and reasonable descriptions (100-200 chars). All parameters have type definitions and descriptions. However, output schemas are not documented, LLMs cannot predict return structure. Error handling is absent: no guidance on retryability, user-fixable vs fatal errors, or recovery paths. Parameter constraints lack enums and ranges (e.g., max_results accepts 1-50 but no validation shown). Missing idempotency guidance for download_attachment (write operation). Descriptions are functional but lack dependency hints and prerequisites.
Download an attachment to local storage. Args: message_id: Message ID from list_attachments. attachment_id: Attachment ID from list_attachments. filename: Original filename. subfolder: Optional subfolder name (e.g. 'invoices', 'delivery-notes').
Download an attachment and extract its text content. PDFs are parsed with pypdf, images via tesseract OCR (slk+eng), or forwarded to a configured OCR pipeline service. Args: message_id: Message ID. attachment_id: Attachment ID. filename: Filename (extension determines extraction method). use_ocr_pipeline: If True and OCR_PIPELINE_URL is set, forward to that service.
Find emails with attachments matching a Gmail search query. Args: query: Gmail search query (same syntax as Gmail search bar). Examples: "has:attachment from:[email protected] newer_than:30d" "has:attachment subject:dodací list newer_than:7d" max_results: Max messages to return (1-50, default 20). Returns: List of messages with their attachment metadata.
Output schemas not documented. LLMs cannot predict return structure (fields, types, pagination). Breaks downstream tool chaining and forces agents to guess field names.
No error handling guidance. Responses lack recovery hints (e.g., 'Gmail auth failed, check credentials' or 'Attachment too large, try extract_attachment instead'). Agents cannot self-correct.
Parameter constraints not enforced or validated. max_results claims 1-50 range but no enum/min/max in schema. LLMs can pass invalid values (0, 100, -1) without feedback.
download_attachment is a write operation but lacks idempotency guidance or confirmation step. Agents retrying on ambiguous failures risk duplicate downloads and file overwrites.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | <=2025-11-25 | v2 |
Descriptions lack dependency hints. list_attachments should note 'Call this first to discover message_id and attachment_id for download_attachment.' extract_attachment should explain when to use OCR pipeline vs local tesseract.