Skip to main content
Glama

Upload a file

upload_file

Creates an upload for an input file and returns its file id and where to send the bytes: PUT them to upload.url with the headers it lists (or, for a large file, each part to its URL), then call complete_upload. Name the file in a run's inputs by its file id.

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": {
      "name": "<name>",
      "content_type": "<content_type>",
      "size_bytes": "<size_bytes>"
    },
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe file name.
sha256NoOptional hex sha256 of the bytes, checked at complete_upload.
size_bytesYesThe exact size in bytes. The upload URL accepts this size only.
content_typeYesThe media type, such as video/quicktime or image/png.
idempotency_keyNoOptional. Retrying with the same key and the same request within 24 hours returns the first answer instead of doing it twice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare a non-read-only, non-destructive, non-idempotent, closed-world operation, and the description adds substantive context beyond that: the call does not itself carry the bytes, uploads are two-phase, and large files need per-part uploads. It does not cover failure modes such as URL expiry, partial-part retries, or what the file id looks like.

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

Conciseness4/5

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

Three tight clauses with no filler, and the primary outcome (file id plus upload URL) is front-loaded before the procedural detail. The parenthetical about large-file parts is efficiently placed, though the sentence is dense enough to require a second read.

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

Completeness5/5

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

With no output schema present, the description supplies the return shape itself (file id and upload destination), and it discloses the multi-step protocol an agent must follow to actually get bytes uploaded. Nothing essential to calling this five-parameter tool correctly is missing.

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 description coverage is 100%, so name, content_type, size_bytes, sha256 and idempotency_key are already documented in the schema. The description adds only indirect meaning (the file id is what you reference in a run's inputs) and does not touch the size constraint, checksum, or idempotency parameters, so the baseline 3 applies.

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 ('Creates an upload for an input file') and immediately describes the concrete return payload: the file id and where to send bytes. It also distinguishes itself from the sibling complete_upload by naming it as the required follow-up step.

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 the full call sequence: PUT bytes to upload.url with the listed headers, use per-part URLs for large files, then call complete_upload, and reference the file id in a run's inputs. It is clear about the required next step, but gives no explicit when-not or comparison against any alternative upload path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.