upload-file-content
upload-file-contentOverwrite a file's content by sending base64-encoded data to a specified drive item, replacing the existing content with the newly uploaded bytes.
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. Graph accepts up to 250MB here, but the whole string travels as a tool argument and a truncated one decodes to a truncated file with no error, so use create-upload-session rather than emitting a large base64 string. 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 |