Skip to main content
Glama
Microsoft 365 MCP Server

Microsoft 365 MCP Server

by Softeria

get-upload-url

Creates a short-lived, single-use upload URL so file bytes go directly to Microsoft Graph and attach to a draft message or event without passing base64 through the agent.

Instructions

Mint a short-lived, single-use URL that this server serves for uploading a file as an attachment to a draft message or an event, so the bytes go straight from the caller to Microsoft Graph instead of passing as base64 through the agent context. target is the attachments collection of the item: /me/messages/{message-id}/attachments (a draft; create it first) or /me/events/{event-id}/attachments. PUT the raw file bytes to the returned uploadUrl with a Content-Length (e.g. curl -T file ""); the response confirms the attachment. Files under 3 MB are attached directly, larger ones (up to 150 MB) through a Graph upload session. Pass contentId to attach inline, e.g. a signature picture the HTML body shows with . Requires --enable-attachment-urls. Returns { uploadUrl, method, expiresAt, singleUse, maxBytes }.

Input Schema

NameRequiredDescriptionDefault
nameYesAttachment file name as the recipient will see it, e.g. report.pdf
targetYesAttachments collection of a draft message or an event, e.g. /me/messages/{message-id}/attachments, /me/events/{event-id}/attachments, or /users/{user-id}/messages/{message-id}/attachments for another mailbox.
contentIdNoAttach inline under this Content-ID instead of as a regular attachment, so the HTML body can show the file with <img src="cid:<contentId>">, e.g. a picture in an email signature. Letters, digits, ".", "_", "@", "-".
contentTypeNoMIME type of the file, e.g. application/pdf. Defaults to application/octet-stream.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.178.0
    • changedInput schema / properties / target / description
      Previous value: -"Attachments collection of a draft message or an event, e.g. /me/messages/{message-id}/attachments or /me/events/{event-id}/attachments."New value: +"Attachments collection of a draft message or an event, e.g. /me/messages/{message-id}/attachments, /me/events/{event-id}/attachments, or /users/{user-id}/messages/{message-id}/attachments for another mailbox."
  2. Changed1 schema field changedv0.175.0
    • addedInput schema / properties / contentId
      Added value: +{
      +  "description": "Attach inline under this Content-ID instead of as a regular attachment, so the HTML body can show the file with <img src=\"cid:<contentId>\">, e.g. a picture in an email signature. Letters, digits, \".\", \"_\", \"@\", \"-\".",
      +  "type": "string"
      +}
  3. Addedv0.166.0

TDQS

A4.6/5.0
Behavior5/5

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

With only readOnlyHint=false and openWorldHint=true from annotations, the description carries the burden well: it discloses the URL is short-lived and single-use, states the size thresholds (3 MB direct, 150 MB via Graph upload session), names the required server flag --enable-attachment-urls, and spells out the exact PUT procedure and confirmation behavior.

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 the purpose in the first clause, then procedures and constraints. Every sentence carries operational content (size limits, flag gate, PUT wording, return shape). It is dense and long for a single paragraph, which costs a little scannability.

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, and the description compensates by enumerating the return shape { uploadUrl, method, expiresAt, singleUse, maxBytes }. Combined with the size limits, auth flag requirement, and target examples, an agent has everything needed to call and consume this tool correctly.

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 baseline is 3; the description goes beyond it by explaining target as a collection path with a concrete draft-vs-event distinction and by tying contentId to the cid: reference in HTML bodies. It doesn't elaborate much on name or contentType beyond schema, but the added semantics for the two key parameters are real.

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+resource: mint a short-lived, single-use upload URL for attaching a file to a draft message or event. It also pins the scope (attachments collection of a draft message or event) and explains the architectural reason (bytes go straight to Graph, not through agent context), which distinguishes it from add-mail-attachment and create-mail-attachment-upload-session.

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?

Gives concrete when-to-use context: target must be an existing draft ('create it first') or an event, PUT raw bytes with Content-Length, use contentId for inline images, and requires --enable-attachment-urls. The 3 MB / 150 MB thresholds implicitly route small files to a different mechanism, but no sibling is named explicitly as the alternative for those cases.

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