upload-file-content
upload-file-contentUpload base64-encoded file content to a specified OneDrive file item. Overwrites existing files without warning. Max 4MB inline; use create-upload-session for larger files.
Instructions
The content stream, if the item represents a file.
š” TIP: Body is a base64-encoded string of the file bytes; the server decodes it before PUT. Max 4MB inline (use create-upload-session above 4MB). For new files use path format: /items/root:/path/to/file.txt:/content. Overwrites existing files without warning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Base64-encoded file content. The server decodes it and PUTs the raw bytes to Microsoft Graph. | |
| confirm | No | 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. | |
| driveId | Yes | Value for the 'driveId' path segment. Pass it under the name 'driveId', not as 'id'. Use the 'id' field of the drive object as returned by Microsoft Graph. | |
| driveItemId | Yes | Value for the 'driveItemId' path segment. Pass it under the name 'driveItemId', not as 'id'. Use the 'id' field of the drive item object as returned by Microsoft Graph. | |
| includeHeaders | No | Include response headers (including ETag) in the response metadata | |
| excludeResponse | No | Exclude the full response body and only return success or failure indication |