Upload Text File to OneDrive
upload_fileUpload plain text, Markdown, CSV, JSON, HTML, or XML content directly to OneDrive. Use it for small text uploads; binary files need a different upload tool.
Instructions
Upload TEXT content (plain text, markdown, CSV, JSON, HTML, XML) to OneDrive inline via this tool call. For binary files (docx, pdf, images, etc.), use get_upload_config (HTTP/SSE) or upload_file_from_path (stdio/local) — never base64-encode binary into this tool's content param. Max ~4 MB text.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Destination path in colon-path format (e.g., /me/drive/root:/Documents/file.txt:/content) | |
| content | Yes | Text content to upload (UTF-8) | |
| if_match | No | eTag from download_file, get_drive_item or list_drive_items. Replaces the file only if it hasn't changed since; otherwise fails with precondition-failed, and nothing is written. Implies conflict_behavior replace | |
| content_type | No | MIME type of the content, default text/plain. Must be a text type (text/*, application/json, application/xml, application/javascript, *+json, *+xml); binary types are rejected. It only gates this check: OneDrive decides the stored file's MIME type itself and may not keep this value. | |
| conflict_behavior | No | Conflict behavior: "rename" (default), "replace" overwrites, "fail" returns 409 on collision. Use "fail" to create a file only if none exists yet |