Skip to main content
Glama
Microsoft 365 MCP Server

Microsoft 365 MCP Server

by Softeria

download-bytes

Read-only

Retrieves binary content from Microsoft Graph—such as drive files, mail attachments, profile photos, and Teams hosted content—and returns it as base64.

Instructions

Download binary content from Microsoft Graph and return it as base64. Single tool for any binary read: drive file content, mail attachment, profile photo, Teams hosted content, meeting recording. Returns { contentType, encoding: "base64", contentLength, contentBytes }. For large drive/SharePoint file content, prefer get-download-url, which returns a pre-authenticated URL to stream bytes out-of-band instead of base64 through the agent context. With --enable-attachment-urls in HTTP mode, also prefer get-download-url for document reads from authenticated byte endpoints. With the server's blob output on, the bytes come back as a file resource instead (capped by the server's download limit); pass fileName to name it.

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": {
      "target": "<target>"
    },
    "name": "download-bytes"
  }
}

Input Schema

NameRequiredDescriptionDefault
acceptNoOptional Accept header. Set only when Graph asks for another format (transcript content: application/vnd.microsoft.graph.transcript+text).
targetYesRelative Microsoft Graph path starting with "/". Common paths: /drives/{drive-id}/items/{driveItem-id}/content (drive file content); /me/messages/{message-id}/attachments/{attachment-id}/$value (mail attachment, list-mail-attachments returns the IDs); /me/photo/$value or /users/{user-id}/photo/$value (profile photo); /chats/{chat-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams chat hosted content, list-chat-message-hosted-contents returns the IDs); /teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams channel hosted content). For meeting recordings, use get-meeting-recording-content where available; Microsoft Graph returns authenticated recording bytes, not a pre-authenticated download URL.
fileNameNoName of the file, used as the last segment of the returned resource URI when the server runs with blob output. Optional.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.181.0
    • addedInput schema / properties / accept
      Added value: +{
      +  "description": "Optional Accept header. Set only when Graph asks for another format (transcript content: application/vnd.microsoft.graph.transcript+text).",
      +  "maxLength": 256,
      +  "pattern": "^(?:[\\x21-\\x7E](?:[\\x20-\\x7E]*[\\x21-\\x7E])?)?$",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv0.166.0
    • addedInput schema / properties / fileName
      Added value: +{
      +  "description": "Name of the file, used as the last segment of the returned resource URI when the server runs with blob output. Optional.",
      +  "type": "string"
      +}
  3. Addedv0.134.4
  4. Removedv0.131.2
  5. Changed1 schema field changedv0.128.1
    • changedInput schema / properties / target / description
      Previous value: -"Relative Microsoft Graph path starting with \"/\". Common paths: /drives/{drive-id}/items/{driveItem-id}/content (drive file content); /me/messages/{message-id}/attachments/{attachment-id}/$value (mail attachment, list-mail-attachments returns the IDs); /me/photo/$value or /users/{user-id}/photo/$value (profile photo); /chats/{chat-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams chat hosted content, list-chat-message-hosted-contents returns the IDs); /teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams channel hosted content). For meeting recordings (often large), use get-meeting-recording-content which returns a URL for out-of-band download by the client."New value: +"Relative Microsoft Graph path starting with \"/\". Common paths: /drives/{drive-id}/items/{driveItem-id}/content (drive file content); /me/messages/{message-id}/attachments/{attachment-id}/$value (mail attachment, list-mail-attachments returns the IDs); /me/photo/$value or /users/{user-id}/photo/$value (profile photo); /chats/{chat-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams chat hosted content, list-chat-message-hosted-contents returns the IDs); /teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}/hostedContents/{chatMessageHostedContent-id}/$value (Teams channel hosted content). For meeting recordings, use get-meeting-recording-content where available; Microsoft Graph returns authenticated recording bytes, not a pre-authenticated download URL."
  6. Addedv0.114.0
  7. Removedv0.112.2
  8. Addedv0.110.0
  9. Removedv0.108.0
  10. Addedv0.99.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds the parts an agent actually needs: the exact return envelope ({ contentType, encoding: "base64", contentLength, contentBytes }), the cost of pulling base64 through agent context versus an out-of-band pre-authenticated URL, and the alternate blob-output behavior where bytes arrive as a file resource capped by the server download limit. It is consistent with readOnlyHint=true (pure read, no side effects disclosed).

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 with purpose and coverage, then return shape, then alternative-routing rules — the ordering matches how an agent decides. It is dense but every clause carries routing or behavior information; only the Accept sentence mildly duplicates 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?

No output schema exists, yet the description fully specifies the return envelope and the alternate blob-mode return, plus the limits and the alternatives for cases this tool handles poorly. For a single-path binary fetch with three parameters, nothing an agent needs in order to call it correctly is missing.

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; the description goes further by explaining that fileName only takes effect as the last URI segment under blob output, which tells the agent when the parameter matters. The Accept guidance largely restates the schema's own accept description, so it does not add much beyond 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 and resource ("Download binary content from Microsoft Graph and return it as base64") and immediately enumerates the covered resource families: drive content, mail attachment, profile photo, Teams hosted content, meeting recording. This makes it distinguishable from siblings like get-download-url, get-mail-attachment-content and download-bytes-to-file without opening any 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 routing rules: prefer get-download-url for large drive/SharePoint content, and also for document reads when --enable-attachment-urls is set in HTTP mode; use get-meeting-recording-content for recordings. It states both when to use this tool and when a named alternative wins, with the condition that selects it.

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