Skip to main content
Glama
Softeria

Microsoft 365 MCP Server

by Softeria

get-mail-attachment-content

get-mail-attachment-content
Read-only

Download the raw bytes of a file attachment of an Outlook message in the signed-in user's mailbox, by message ID and attachment ID.

Instructions

Download the raw bytes of a file attachment of an Outlook message in the signed-in user's mailbox, by message ID and attachment ID.

đź’ˇ TIP: Find the attachment id with list-mail-attachments first. With the server's blob output on, the bytes come back as a file resource; pass fileName (the attachment's name) to name it. Files over the server's download limit are refused with an error naming the limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNameNoName of the file, used as the last segment of the returned resource URI when the server runs with blob output. Optional.
messageIdYesValue for the 'messageId' path segment. Pass it under the name 'messageId', not as 'id'. Use the 'id' field of the message object as returned by Microsoft Graph.
attachmentIdYesValue for the 'attachmentId' path segment. Pass it under the name 'attachmentId', not as 'id'. Use the 'id' field of the attachment object as returned by Microsoft Graph.
fetchAllPagesNoFollow @odata.nextLink and merge up to 100 pages into one response. Can return enormous payloads—only when the user explicitly needs a full export. Prefer a small $top first, then paginate or narrow with $filter/$search.
includeHeadersNoInclude response headers (including ETag) in the response metadata
excludeResponseNoExclude the full response body and only return success or failure indication

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.166.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint, destructiveHint false, openWorldHint), so the description focuses on adding value: blob-output mode returning a file resource, the role of fileName in naming that resource, and the download-limit refusal with an error naming the limit. This usefully discloses failure behavior, though it stops short of describing pagination or the non-blob return shape.

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?

Front-loads the verb and resource in the first sentence, then a single tip sentence covering the prerequisite, blob-output behavior, fileName, and the limit error. No filler; every clause earns its place.

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?

For a read-only binary-fetch tool with annotations already declaring safety and no output schema, the description covers the remaining essentials: the required identifiers, how to obtain them, the return form, and the failure mode at the download limit. An agent has everything needed to call it correctly.

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, which sets the baseline at 3. The description adds only modestly, explaining that fileName names the returned resource under blob output; the messageId/attachmentId semantics are already fully covered by the schema.

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 (Download), the exact resource (raw bytes of a file attachment of an Outlook message in the signed-in user's mailbox), and the identifying keys (message ID and attachment ID). It also names the sibling list-mail-attachments as the way to obtain the required id, distinguishing it from adjacent 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?

Explicitly routes the agent: 'Find the attachment id with list-mail-attachments first', which is a clear prerequisite and names the alternative for the lookup step. It gives clear context but does not compare against other nearby retrieval options (e.g. get-mail-message-mime or download-bytes) or state when-not-to-use, so it falls short of a full 5.

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