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). After the bytes are sent, complete_upload makes the file ready, and a run names it in its 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.1/5.0
Behavior4/5

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

Annotations only declare non-read-only, closed-world, non-idempotent, non-destructive; the description adds the genuinely useful behavior: a two-phase protocol, the PUT target with required headers, and per-part URLs for large files. It omits operational details such as URL expiry, what happens on a size/hash mismatch, and that an idempotency key can make retries safe.

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?

One dense, front-loaded sentence that leads with the action and return value before the follow-up steps. The nested parenthetical about part URLs is slightly compressed but earns its place; nothing is redundant.

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?

With no output schema, the description carries the return contract (file id plus upload URL and headers) and does so adequately, along with the completion handoff. Gaps remain on URL lifetime, size caps, and failure modes, which matter for a multi-step upload.

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 name, content_type, size_bytes, sha256 and idempotency_key are already documented. The description adds the connection between large files and multipart URLs but does not explain the idempotency_key or sha256 behavior itself, so the schema does the heavy lifting.

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 concrete verb+resource (creates an upload for an input file) and what it returns (file id and where to send bytes). It also positions itself in the flow relative to complete_upload, so an agent can tell which call starts the process.

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?

Explicitly sequences the workflow: call this first, PUT bytes to upload.url, then call complete_upload, and reference the file id in a run's inputs. The next-step alternative is named with its triggering condition. There is no when-not guidance (e.g., size limits or when to reuse an existing file), which keeps it from a 5.

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.