Skip to main content
Glama

Upload Local File to OneDrive

upload_file_from_path
Destructive

Upload a local file from disk to OneDrive by path, with chunked uploads for files up to 250 MB and automatic creation of intermediate folders.

Instructions

Upload a local file to OneDrive by reading it from disk on the server. The file must exist on this machine's filesystem. If you generated the file in a cloud container (e.g., claude.ai), first use Desktop Commander's write_file to save it to the user's local filesystem, then call this tool with that local path. Supports files up to 250 MB (chunked session upload above 4 MB). Intermediate folders are auto-created.

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": {
      "local_path": "<local_path>",
      "path": "<path>"
    },
    "name": "upload_file_from_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesGraph API destination path ending with :/content (e.g., /me/drive/root:/Documents/file.docx:/content)
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
local_pathYesAbsolute path to the local file to upload
content_typeNoMIME type override. Auto-detected from file extension if omitted.
conflict_behaviorNoConflict behavior: "rename" (default), "replace" overwrites, "fail" returns an error. 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 an error"New value: +"Conflict behavior: \"rename\" (default), \"replace\" overwrites, \"fail\" returns an error. 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.2/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 description earns credit for adding operational detail beyond them: the 250 MB cap, the 4 MB chunked-session threshold, and the side effect that intermediate folders are auto-created. It does not restate overwrite semantics, but the schema's conflict_behavior and if_match fields already cover those, so nothing important is hidden.

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?

Four sentences, each with a distinct job: what it does, the precondition, the fallback workflow, then the limits and side effects. Front-loaded and free of filler.

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 destructive write tool with no output schema, the description covers the prerequisite, size ceiling, transfer mechanics, and folder side effect, which is what an agent needs to call it safely. The only gap is that it never says what the successful response contains (e.g., the created drive item), which would matter for chaining.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all five parameters including the conflict_behavior enum and if_match failure semantics are already documented in the schema. The description only reinforces that local_path is a server-side absolute path, which the schema essentially says; baseline 3 is appropriate when the schema carries the parameter burden.

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?

States a specific verb and resource ("Upload a local file to OneDrive by reading it from disk on the server") and immediately narrows the tool's identity by contrasting it with path-less/cloud-origin uploads, which separates it from the sibling upload_file. An agent can tell what this does 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 Guidelines4/5

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

Gives a clear precondition ("The file must exist on this machine's filesystem") and an explicit workaround when that precondition fails (save via Desktop Commander's write_file first, then call this tool). It does not name the sibling upload_file as the alternative for the in-memory/cloud case, so the routing guidance is clear but not exhaustive.

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