Skip to main content
Glama
sweetrb

apple-mail-mcp

by sweetrb

fetch-attachment

Retrieve an email attachment's raw bytes as base64 by specifying message ID and attachment name. Access contents inline without saving a file.

Instructions

Use when: retrieving an attachment's raw bytes inline as base64 (by message id and attachmentName), e.g. to process its contents without keeping a file. Returns: the attachment's bytes base64-encoded, with its size and (for IMAP) MIME type. Do not use when: you don't know the attachment name (use list-attachments first) or you just want it saved to disk (use save-attachment). Safety: leaves no file behind, but the AppleScript path is not disk-free — Mail writes the attachment into a private temp directory, which is read back and then deleted. Needs no Full Disk Access either way: Mail performs that write under the Automation grant, and this server never reads the mail store itself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
attachmentNameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesNo
mimeTypeNo
contentBase64No
attachmentNameNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility for disclosing side effects and requirements. It covers: no file left behind (but temp file used and deleted), no Full Disk Access needed, and explains the underlying AppleScript temp-directory mechanism. It also states the return format (base64 bytes with size and MIME type), giving a transparent behavioral contract.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: 'Use when', 'Returns', 'Do not use when', and 'Safety'. It is front-loaded with the primary usage, and each sentence contributes unique value — no fluff or repetition. The length is appropriate for the level of detail, covering purpose, exclusions, output, and safety in a compact manner.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity and the presence of an output schema (which handles return structure), the description goes beyond the minimum. It explains when to use, when not to use with alternatives, side effects (temp file handling), permission requirements, and return content. It effectively addresses all essential context for correct invocation, including a dependency on list-attachments for unknown names.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema coverage is 0%, but the description adds meaning by stating 'by message id and attachmentName' and clarifying that attachmentName must be known (with a suggestion to use list-attachments). It doesn't elaborate on the id pattern, but the schema already has a permissive regex. The description gives sufficient semantic context to understand what each parameter represents and how to obtain the correct value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: 'retrieving an attachment's raw bytes inline as base64 (by message id and attachmentName)'. It clearly differentiates from siblings by explicitly naming alternatives: 'use save-attachment' for saving to disk and 'use list-attachments first' when the attachment name is unknown. The verb+resource+scope is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: it starts with 'Use when:' and includes a dedicated 'Do not use when:' section that names concrete alternatives for both exclusions. This directly addresses when to use this tool versus list-attachments and save-attachment, which are the most relevant siblings.

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/sweetrb/apple-mail-mcp'

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