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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Attachment file name as the recipient will see it, e.g. report.pdf | |
| target | Yes | 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. | |
| contentId | No | 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, ".", "_", "@", "-". | |
| contentType | No | MIME type of the file, e.g. application/pdf. Defaults to application/octet-stream. |