Skip to main content
Glama

Upload Text File to OneDrive

upload_file
Destructive

Upload 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

NameRequiredDescriptionDefault
pathYesDestination path in colon-path format (e.g., /me/drive/root:/Documents/file.txt:/content)
contentYesText content to upload (UTF-8)
if_matchNoeTag 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_typeNoMIME 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_behaviorNoConflict behavior: "rename" (default), "replace" overwrites, "fail" returns 409 on collision. Use "fail" to create a file only if none exists yet

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.0
    • changedInput schema / properties / conflict_behavior / description
      Previous value: -"Conflict behavior: \"rename\" (default), \"replace\" overwrites, \"fail\" returns 409 on collision"New value: +"Conflict behavior: \"rename\" (default), \"replace\" overwrites, \"fail\" returns 409 on collision. Use \"fail\" to create a file only if none exists yet"
    • addedInput schema / properties / if_match
      Added value: +{
      +  "description": "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",
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, so the safety profile is covered. The description adds non-obvious behavior beyond that: an approximate ~4 MB text size ceiling and the fact that uploads happen inline through the tool call rather than via a staged upload session. It doesn't describe what a successful response returns or any permission requirements, keeping it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the primary capability, followed by the routing rule and the key constraint. The parenthetical format list and the ~4 MB limit are compact and every clause carries actionable information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no output schema, the definition covers the essentials: scope, alternatives, size limit, and content-type restrictions. The remaining gap is minor—it doesn't say what a successful upload yields (e.g., a drive item with id/eTag) or how to chain into overwrite flows, though if_match and conflict_behavior are fully explained in the schema.

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 the baseline is 3, but the description adds meaning beyond the schema by warning that the content param must never carry base64-encoded binary and by implying a size constraint that applies to that param. The path/if_match/conflict_behavior semantics remain entirely schema-documented, which is adequate given full coverage.

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?

The opening sentence names a specific verb (upload), a specific resource type (TEXT content, with examples), and a specific destination (OneDrive) via an inline tool call. It immediately distinguishes itself from the file-path sibling and from binary upload paths, so an agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states both when to use this tool (inline text: plain text, markdown, CSV, JSON, HTML, XML) and when not to (docx, pdf, images), and names the alternatives get_upload_config for HTTP/SSE transports and upload_file_from_path for stdio/local. It adds an explicit prohibition against base64-encoding binary into the content param, which removes the most likely misuse.

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