Skip to main content
Glama

Attachments

attachments

List, view, or download files attached to an email message; inspect metadata, read text-based content, and save to an allowed directory.

Instructions

Inspect or retrieve email attachments. action=list (default) returns metadata for all attachments on messageId (id, name, contentType, size, isInline) — read-only. action=view returns inline content for text/JSON/XML attachments via attachmentId; binary types require download. action=download saves the attachment under a new, unique name in outputDir (default system temp directory, auto-created; must be inside the temp directory, ~/Downloads, ~/Documents or OUTLOOK_EXPORT_DIR) and returns the saved file path. messageId is required for all actions; attachmentId is required for view/download. If messageId came from a shared/delegated mailbox, pass the same sharedMailbox (or alias email) — attachment IDs are scoped to the message and fail under /me otherwise. Use outputVerbosity to control list field count.

Input Schema

NameRequiredDescriptionDefault
emailNoAlias for `sharedMailbox`.
actionNoAction to perform (default: list)
savePathNoDEPRECATED alias for `outputDir`. Will be removed in a future release.
messageIdYesEmail message ID (required)
outputDirNoAbsolute directory (or ~/…) to save the file in (action=download, default: system temp directory). Auto-created if missing. Must be inside the system temp directory, ~/Downloads, ~/Documents or OUTLOOK_EXPORT_DIR, with no dot-prefixed folder names.
attachmentIdNoAttachment ID (action=view/download, required)
sharedMailboxNoEmail address of the shared/delegated mailbox the messageId belongs to. Required when the message came from a shared mailbox. Requires delegate access + Mail.Read.Shared. Work/school only; needs the server opt-in setting OUTLOOK_SHARED_MAILBOX (otherwise the call is refused with setup guidance).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.14.1
    • addedInput schema / properties / email
      Added value: +{
      +  "description": "Alias for `sharedMailbox`.",
      +  "type": "string"
      +}
    • changedInput schema / properties / outputDir / description
      Previous value: -"Directory to save file (action=download, default: system tmpdir). Auto-created if missing."New value: +"Absolute directory (or ~/…) to save the file in (action=download, default: system temp directory). Auto-created if missing. Must be inside the system temp directory, ~/Downloads, ~/Documents or OUTLOOK_EXPORT_DIR, with no dot-prefixed folder names."
    • addedInput schema / properties / sharedMailbox
      Added value: +{
      +  "description": "Email address of the shared/delegated mailbox the messageId belongs to. Required when the message came from a shared mailbox. Requires delegate access + Mail.Read.Shared. Work/school only; needs the server opt-in setting OUTLOOK_SHARED_MAILBOX (otherwise the call is refused with setup guidance).",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv3.9.0
    • changedInput schema / properties / savePath / description
      Previous value: -"DEPRECATED alias for `outputDir`. Will be removed in v3.8.0."New value: +"DEPRECATED alias for `outputDir`. Will be removed in a future release."
  3. Changed3 schema fields changedv3.7.4
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / outputDir
      Added value: +{
      +  "description": "Directory to save file (action=download, default: system tmpdir). Auto-created if missing.",
      +  "type": "string"
      +}
    • changedInput schema / properties / savePath / description
      Previous value: -"Directory to save file (action=download, default: current directory)"New value: +"DEPRECATED alias for `outputDir`. Will be removed in v3.8.0."
  4. First observedv3.4.1

TDQS

A4.6/5.0
Behavior4/5

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

With annotations already declaring openWorldHint and destructiveHint=false, the description still adds real behavioral context: list is read-only, download writes a file under a new unique name with path restrictions and auto-creation, and attachment IDs are message-scoped and fail under /me without sharedMailbox. It does not, however, disclose rate limits or failure behavior for download when a name collides beyond the 'unique name' note.

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 dense but well organized, front-loading the action semantics and routing constraints before parenthetical defaults. It is longer than average because it covers three actions, and the 'Use outputVerbosity' sentence references a parameter absent from the schema, which slightly muddies an otherwise tight structure.

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?

With no output schema, the description compensates by naming the list fields returned (id, name, contentType, size, isInline) and the download return value (saved file path), plus the inline-content behavior for view. Everything needed to invoke each action correctly is present.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter dependency semantics the schema does not: messageId required for all actions, attachmentId required only for view/download, and sharedMailbox/email needing to mirror the mailbox the messageId came from. It also names outputVerbosity, which is not present in the input schema at all.

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 opens with a specific verb+resource ('Inspect or retrieve email attachments') and then enumerates the three distinct operations the single tool supports, each with its own return shape. An agent can distinguish list vs view vs download without opening the 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?

It states the default (action=`list`), explains that binary types cannot be viewed and must be downloaded, and gives the exact condition to use the sharedMailbox parameter ('if messageId came from a shared/delegated mailbox'). Alternatives and when-not conditions are explicit.

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