Skip to main content
Glama

add-mail-attachment

add-mail-attachment
Destructive

Attach a file to a Microsoft 365 email message by specifying the message ID and base64-encoded attachment data. Supports attachments under 3MB.

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
Behavior4/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, so the mutation nature is known. The description adds significant behavioral detail: the 400 error on truncated base64, the size threshold, and the required @odata.type in the body. It does not contradict annotations and provides extra context about failure modes.

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 relatively concise but has a truncated sentence: 'An attachment can be one of the following types: All these types of attachment resources are derived from the attachment resource.' This is incomplete and adds noise. However, the key tip is well-structured and front-loaded, earning points for overall efficiency.

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

Completeness4/5

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

Given it's a mutation tool with destructiveHint and no output schema, the description covers the critical context: size limits, body format, and alternative tool. It doesn't describe return values, but that's not expected without an output schema. It is complete enough for an agent to execute correctly, with minor gaps like not explaining other parameters (confirm, includeHeaders).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description goes beyond the schema by specifying that the body must include @odata.type with a concrete example. This is critical because the schema only lists generic fields like name and size, not the required structure. The description compensates for the schema's lack of required format, making the body parameter semantics clear.

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 clearly states 'create a new Attachment' with a specific verb and resource. It distinguishes itself from the sibling create-mail-attachment-upload-session by explicitly stating it is for attachments under 3MB, making it unambiguous which tool to use for small attachments.

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 gives explicit usage criteria: 'The only path for attachments under 3MB' and instructs to use create-mail-attachment-upload-session for 3MB and above. It also warns about truncation failure with a specific error, providing clear when-to-use and when-not-to-use guidance.

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/A-Impact-Pavel/ms365-mcp'

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