Skip to main content
Glama

get_mail_attachment

Saves one email attachment to this Mac and returns its absolute path; supported images and documents also return preview content as image or text.

Instructions

Save one attachment of a message as a file on this Mac and return its absolute path. Images (JPEG, PNG, GIF, WebP, HEIC) are also returned as an image. PDF, text, RTF, DOC and DOCX files are also returned as text (cut at 100000 characters). Other types return the path only. Files above 25 MB are refused. Attachments of Mail that are not downloaded yet cannot be saved. The file is kept for 24 hours. Give the attachment by 'name' or 'index' from get_message. Needs 'confirm' true on every call. Ask the user first, because the file is copied to ~/Library/Caches/applesauce/attachments.

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>"
    },
    "name": "get_mail_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesMessage id from search_mail.
nameNoAttachment name from get_message. Give 'name' or 'index', not both.
indexNoAttachment number from get_message. The first is 1.
confirmNoMust be true. Ask the user first: the call copies the attachment to this Mac.
in_accountNoAccount id of the message (the 'account_id' field of search_mail). Only needed with 'in_mailbox'.
in_mailboxNoMailbox path of the message (the 'mailbox' field of search_mail). Only needed when Full Disk Access is missing. Give 'in_account' too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

The description adds substantial behavior beyond the annotations: image and text conversion rules, 100000-character truncation, a 25 MB size limit, the requirement that attachments already be downloaded, and a 24-hour retention period. It also discloses the cache location and the mandatory user-confirmation step, which are operationally important details not captured by the annotations.

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?

The description is a single front-loaded paragraph that starts with the core action and then layers in return formats, constraints, and usage requirements. Most sentences earn their place, though the name/index and confirm requirements are partly duplicated from the schema.

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 tool's complexity and the absence of an output schema, the description is complete: it explains what is returned for images, text-like documents, and other file types, plus the truncation and size limits. It also covers failure conditions such as undownloaded attachments and the 24-hour file lifetime.

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 100%, so all six parameters are already documented in the input schema, including name/index, confirm, and in_account/in_mailbox. The description mostly restates those schema details rather than adding new parameter-specific meaning, so the baseline 3 applies.

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

Purpose4/5

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

The description states a specific verb and resource: save one attachment of a message as a file on this Mac and return its absolute path. It is clear what the tool does, but it does not explicitly distinguish itself from the sibling get_note_attachment or explain when to choose this over message-fetching tools.

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

Usage Guidelines4/5

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

It gives clear usage context: identify the attachment by name or index from get_message, set confirm true on every call, and ask the user first because the file is copied to a cache directory. It also lists key constraints, but it does not state when not to use this tool or name an alternative for note attachments.

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