Skip to main content
Glama
apple-mail-mcp

apple-mail-mcp

by sweetrb

fetch-attachment

Read-only

Retrieve an email attachment's raw bytes inline as base64 by message ID and attachment name to process contents without saving a file; attachments over 3 MiB are refused.

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: up to 3 MiB of decoded attachment bytes, base64-encoded, with its size and (for IMAP) MIME type. Larger attachments are refused; use save-attachment instead. 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "attachmentName": "<attachmentName>"
    },
    "name": "fetch-attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
attachmentNameYes

Output Schema

NameRequiredDescriptionDefault
bytesNo
mimeTypeNo
contentBase64No
attachmentNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.10.24
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv2.10.8
    • changedOutput schema / additionalProperties
      Previous value: -falseNew value: +true
  3. Addedv2.8.14
  4. Removedv2.8.10
  5. First observedv2.6.1

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, it discloses the 3 MiB decode cap and refusal behavior for oversized attachments, the base64 return shape with size and IMAP MIME type, and the non-obvious side effect that Mail writes to a private temp directory that is read back and deleted. It also resolves a real agent concern (Full Disk Access vs Automation grant), which no annotation conveys.

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

Conciseness4/5

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

Front-loaded 'Use when' / 'Returns' / 'Do not use when' / 'Safety' labels make it scannable and every section is actionable. The safety paragraph is noticeably longer than the rest and could be tightened, but its detail is genuinely non-obvious rather than filler.

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?

An output schema exists, yet the description still usefully previews the payload (base64 bytes, size, MIME type) so the agent knows what it will receive. Combined with the size limit, the temp-file caveat, and the permission model, nothing an agent needs in order to call this correctly or handle its failure mode is missing.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must supply meaning — it does explain that the attachment is addressed by message id plus attachmentName and that the name must be discovered via list-attachments first. However, it never clarifies the id pattern (numeric local id vs the 'imap:<token>' form encoded in the regex) or whether attachmentName is an exact, case-sensitive match, leaving the two required parameters only partly disambiguated.

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?

States a specific verb and resource ('retrieving an attachment's raw bytes inline as base64') plus the exact addressing keys (message id and attachmentName). It explicitly distinguishes itself from save-attachment and list-attachments, so an agent can pick it out of a 50-tool sibling list without reading either schema.

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?

Gives explicit when-to-use ('process its contents without keeping a file'), explicit when-not ('you don't know the attachment name', 'you just want it saved to disk'), and names the correct alternative for each exclusion. This is the full when/when-not/alternative triad.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.