Skip to main content
Glama

create-mail-attachment-upload-session

Destructive

Initiate an upload session to attach large files (3-150 MB) to Outlook messages or events. Provides an upload URL for sequential byte range uploads to resume interrupted transfers.

Instructions

Create an upload session that allows an app to iteratively upload ranges of a file, so as to attach the file to the specified Outlook item. The item can be a message or event. Use this approach to attach a file if the file size is between 3 MB and 150 MB. To attach a file that's smaller than 3 MB, do a POST operation on the attachments navigation property of the Outlook item; see how to do this for a message or for an event. As part of the response, this action returns an upload URL that you can use in subsequent sequential PUT queries. Request headers for each PUT operation let you specify the exact range of bytes to be uploaded. This allows transfer to be resumed, in case the network connection is dropped during upload. The following are the steps to attach a file to an Outlook item using an upload session: See attach large files to Outlook messages or events for an example.

💡 TIP: For large attachments (3-150MB). Body: { AttachmentItem: { attachmentType: 'file', name: 'report.pdf', size: 5000000 } }. Returns a pre-authenticated uploadUrl for direct PUT of file bytes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
messageIdYesPath parameter: messageId
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 indicate a destructive mutation (readOnlyHint=false, destructiveHint=true). The description adds behavioral context beyond annotations: it creates an upload session, returns an upload URL, supports iterative PUT operations with range headers, and allows transfer resume. It does not contradict annotations. Score 4 because it provides rich behavioral details, but could explicitly mention idempotency or side effects.

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 front-loaded with the core purpose and includes a helpful tip. While it is somewhat lengthy, every sentence adds value (e.g., size constraints, alternative, steps). It could be more concise, but the structure is logical and aids understanding.

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?

Given the tool's complexity, lack of output schema, and the presence of a nested parameter, the description is complete. It explains the upload session concept, file size threshold, process steps, and return value (upload URL). It also references an example. The context signals (parameter count, required params) are adequately addressed.

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 75%. The description adds meaning for the 'body' parameter by specifying that it should contain an AttachmentItem with required fields (attachmentType, name, size). For other parameters (messageId, includeHeaders, excludeResponse), it adds little beyond schema. However, given the high coverage, a score of 4 is appropriate as the description compensates for the schema's lack of explicit field documentation.

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 it creates an upload session to iteratively upload file ranges for attaching to an Outlook item (message or event). It specifies the file size range (3-150 MB) and distinguishes from the alternative for smaller files. This provides a specific verb+resource and differentiates from siblings.

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 states when to use this tool (file size between 3 MB and 150 MB) and when not to (smaller than 3 MB, use POST). It names the alternative approach ('do a POST operation on the attachments navigation property'). This meets the highest standard for usage 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/Softeria/ms-365-mcp-server'

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