Skip to main content
Glama
Softeria

Microsoft 365 MCP Server

by Softeria

add-mail-attachment

add-mail-attachment
Destructive

Attach a file to an email by sending the message ID and base64-encoded content. Supports files up to 3MB through a single Microsoft Graph request.

Instructions

Use this API to create a new Attachment. An attachment can be one of the following types: All these types of attachment resources are derived from the attachment resource.

šŸ’” TIP: The only path for attachments under 3MB. contentBytes must carry the complete base64 verbatim; a truncated argument fails with 400 UnableToDeserializePostBody. At 3MB and above use create-mail-attachment-upload-session, which rejects anything smaller. Body requires @odata.type: {"@odata.type": "#microsoft.graph.fileAttachment", "name": "file.pdf", "contentBytes": ""}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
confirmNoFor destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: "confirmation_required" } without touching user data.
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.
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. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.134.4
    • changedInput schema / properties / messageId / description
      Previous value: -"Path parameter: messageId"New value: +"Value 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."
  2. Changed1 schema field changedv0.131.2
    • changedInput schema / additionalProperties
      Previous value: -falseNew value: +true
  3. Changed1 schema field changedv0.131.1
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "For destructive operations when the confirm gate is enabled (MS365_MCP_REQUIRE_CONFIRM=true; off by default). Set to true only after the user has explicitly approved this action. When the gate is on, calls without confirm: true return { error: \"confirmation_required\" } without touching user data.",
      +  "type": "boolean"
      +}
  4. Addedv0.114.0
  5. Removedv0.112.2
  6. Addedv0.110.0
  7. Removedv0.108.0
  8. First observedv0.31.0

TDQS

A4/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false and destructiveHint=true. The description adds transparency about the under-3MB constraint, the exact error on truncated base64, and the required @odata.type body structure. It does not mention the confirm parameter or any side effects, but it goes beyond annotations by explaining failure modes and size limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short but contains a malformed sentence: 'An attachment can be one of the following types: All these types...' It appears to cut off and doesn't list the types, causing confusion. The rest is efficient, but the structural issue reduces clarity.

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?

The description covers the main usage context (size threshold, base64 format, example body) but lacks information about what the tool returns on success or how the messageId is used. It doesn't mention that it adds to a specific message, though that is implied. The incomplete type list also leaves a gap.

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 80%, so baseline is 3. The description adds value by giving an example body structure with @odata.type and contentBytes, and emphasizing that contentBytes must be verbatim base64. This clarifies the key parameter beyond what the schema provides, especially since the body object schema is generic with additionalProperties.

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 clearly states the tool creates a new attachment. It distinguishes from the upload-session sibling by size threshold. However, the sentence 'An attachment can be one of the following types' is incomplete and fails to list the actual types, which slightly weakens the purpose. The mention of 'messageId' is only in the schema, not the description.

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?

The description explicitly provides usage guidelines: it states this is the only path for attachments under 3MB and directs to create-mail-attachment-upload-session for larger sizes. It also gives a critical tip about contentBytes being complete base64 to avoid failure, which is specific and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Softeria/ms-365-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server