Skip to main content
Glama

graph_get_mail_attachment

Retrieve a specific email attachment and its base64-encoded content by message and attachment ID, from your own or a shared mailbox.

Instructions

Get a specific email attachment including its content.

The attachment content is returned as base64-encoded data in the 'contentBytes' field. For large attachments, only metadata is practical.

Args: message_id: The email message ID. attachment_id: The attachment ID (from graph_list_mail_attachments). mailbox: Shared mailbox address or user ID to act on. Empty targets your own mailbox. Requires the delegated Mail.*.Shared permissions.

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": {
      "message_id": "<message_id>",
      "attachment_id": "<attachment_id>"
    },
    "name": "graph_get_mail_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
mailboxNo
message_idYes
attachment_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations present, the description carries the full disclosure burden. It does useful work by naming the return field 'contentBytes' and its base64 encoding, flagging the large-attachment limitation, and stating that a shared mailbox requires delegated Mail.*.Shared permissions. However, it says nothing about failure behavior when an attachment is missing, whether contentBytes is absent for non-file or reference attachments, or how size limits are enforced.

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 core behavior and the return-format note are front-loaded, and the Args block keeps parameter notes scannable. A few phrasings are slightly padded (e.g., 'is practical'), but there is no filler or repetition.

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

Completeness3/5

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

For a three-parameter read tool with no annotations and no output schema, the definition covers purpose, the key return field, size behavior, and an auth prerequisite, which is most of what an agent needs. The remaining gaps around error cases and attachments where contentBytes is unavailable leave it at adequate rather than complete.

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 description coverage is 0%, so the description must supply meaning for all three parameters, and it largely does: mailbox is explained as a shared mailbox address or user ID with empty defaulting to the caller's own mailbox and its permission requirement, attachment_id is traced to its producing tool, and message_id is identified as the email message ID. Only message_id is described thinly, which keeps this below a 5.

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 opens with a specific verb and resource ('Get a specific email attachment') and immediately clarifies that the content is included, which separates it from the metadata-only listing sibling. The reference to graph_list_mail_attachments as the source of attachment_id reinforces the distinction, though it is framed as an argument note rather than an explicit routing statement.

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 establishes the call chain (obtain attachment_id from graph_list_mail_attachments first) and gives a practical caveat that large attachments yield only metadata in practice. It stops short of explicit when-not-to-use guidance or naming alternatives for retrieving content another way.

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

Deploy Server

Other Tools