Skip to main content
Glama

Upload a file from this machine

upload_media

Upload media for use in generation. Returns presigned URLs for clients that can upload bytes themselves; run the returned curl_template or POST the upload.fields form to upload.url, then call confirm_upload. Default path for user-attached image/video/audio whose bytes your code environment can read (e.g. /mnt/user-data/uploads in Claude): call this, run the curl_template with curl, then confirm_upload — do not ask the user to re-upload. Fall back to upload_media_widget only when the file is unreadable or the POST fails.

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": {
      "content_type": "<content_type>",
      "bytes": "<bytes>"
    },
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
bytesYesThe file's real size in bytes, read off disk: signed as the upload's hard limit.
file_nameNoSingle filename for upload
content_typeYesMIME type for single file upload, e.g. 'image/jpeg', 'image/png', or 'video/mp4'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / content_type / enum
      Previous value: -[
      -  "video/mp4",
      -  "video/quicktime",
      -  "image/png",
      -  "image/jpeg",
      -  "image/webp",
      -  "audio/mpeg",
      -  "audio/wav",
      -  "audio/mp4",
      -  "image/jpg"
      -]New value: +[
      +  "video/mp4",
      +  "video/quicktime",
      +  "image/png",
      +  "image/jpeg",
      +  "image/webp",
      +  "audio/mpeg",
      +  "audio/wav",
      +  "audio/mp4",
      +  "application/zip",
      +  "image/jpg"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / content_type / enum
      Previous value: -[
      -  "video/mp4",
      -  "video/quicktime",
      -  "image/png",
      -  "image/jpeg",
      -  "image/webp",
      -  "image/jpg"
      -]New value: +[
      +  "video/mp4",
      +  "video/quicktime",
      +  "image/png",
      +  "image/jpeg",
      +  "image/webp",
      +  "audio/mpeg",
      +  "audio/wav",
      +  "audio/mp4",
      +  "image/jpg"
      +]
  3. Changed3 schema fields changed
    • changedInput schema / properties / bytes / description
      Previous value: -"The file's real size in bytes, read off disk: signed as the hard limit. Ceilings: see the description."New value: +"The file's real size in bytes, read off disk: signed as the upload's hard limit."
    • changedInput schema / properties / content_type / description
      Previous value: -"The file's real type, taken from the file itself, not its name."New value: +"MIME type for single file upload, e.g. 'image/jpeg', 'image/png', or 'video/mp4'."
    • changedInput schema / properties / file_name / description
      Previous value: -"The local file name, for your own bookkeeping; not stored."New value: +"Single filename for upload"
  4. Changed1 schema field changed
    • changedInput schema / properties / bytes / description
      Previous value: -"The file's real size in bytes, read off disk: signed as the hard limit. Ceiling: 50 MB for a video (500 MB from the sandbox in a studio run), 20 MB for an image."New value: +"The file's real size in bytes, read off disk: signed as the hard limit. Ceilings: see the description."
  5. Changed1 schema field changed
    • changedInput schema / properties / bytes / description
      Previous value: -"The file's real size in bytes, read off disk: signed as the hard limit. Ceiling: 50 MB for a video, 20 MB for an image."New value: +"The file's real size in bytes, read off disk: signed as the hard limit. Ceiling: 50 MB for a video (500 MB from the sandbox in a studio run), 20 MB for an image."
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare the generic mutation profile (readOnlyHint=false, idempotentHint=false, destructiveHint=false). The description goes well beyond that: it discloses the two-step contract (get URLs, then confirm_upload), the two upload mechanisms (curl_template vs. a POST form), and the failure branch that warrants switching tools. That is the non-obvious behavior an agent needs.

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?

Purpose is front-loaded, then mechanism, then the default/fallback decision — a sensible ordering. It is dense and uses long em-dash clauses, but each sentence carries actionable content and nothing is redundant.

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?

For a three-parameter mutation tool with no output schema, the description supplies the missing return-value information (presigned URL, curl_template, form fields) and the required follow-up call. An agent can execute the full flow end to end from this text.

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%, and the schema already explains that `bytes` is the signed hard limit and enumerates the accepted MIME types. The description adds essentially no parameter-level detail of its own beyond the loose phrase about bytes your environment can read, 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 action (upload media for use in generation) and, crucially, what it actually produces: presigned URLs, a `curl_template`, and an `upload.url` with `upload.fields`. The title 'Upload a file from this machine' plus the local-path framing clearly separates it from upload_media_widget, which is named as the different tool.

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?

Explicit default case ('Default path for user-attached image/video/audio whose bytes your code environment can read'), explicit follow-up step (call confirm_upload), explicit exclusion ('do not ask the user to re-upload'), and an explicit fallback condition ('only when the file is unreadable or the POST fails'). An agent has no routing decision left to infer.

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.