Skip to main content
Glama

Upload file

upload_file

Get a link to send one image, video or document from your disk (logo, screenshot, product shot, PDF) for a task to work from. Send the file with an HTTP PUT, e.g. curl -T '<upload_url>'; the answer is JSON with the file_id to pass in files on start_task or reply. The link works for 15 minutes. One file_id works for any number of tasks. A document up to 100 MB, an image up to 20 MB. A video (up to 1 GB) or sound (up to 200 MB) needs size_bytes, its exact size: the answer gives its file_id (or media_id) at once, and the PUT must carry the headers it names, e.g. curl -T -H 'Content-Type: video/mp4' '<upload_url>'. Upload an image or video right before the task that uses it: about 20 can wait unsent, and waiting ones also block your human uploading in the app. A large scan can take minutes to read; start_task says when it is not ready yet. With space_id, a document joins that space's Files instead: every chat in the space reads it, the team sees it, and pin can make it required reading. The answer comes once it is read, with its space_file_id; no file_id is needed for tasks there. A long read answers reading: true, and list_space shows the file when it is done. A PNG, JPEG, WebP, GIF or SVG image with space_id joins that space's Files, where every chat in the space can find it, and answers its image_id: add_images sorts it into the space's collections, pin makes it material every chat reads, and create_element makes it an @element. An MP4, MOV or WebM video or an MP3, WAV or M4A sound with space_id answers a media_id for create_element, good for a day. It joins that space's Files about a minute after it arrives; later, list_space media gives its lasting media_id. An upload without space_id is deleted after a day unless a task uses it.

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

Input Schema

NameRequiredDescriptionDefault
filenameYesIts name with extension, which sets how it is read.
space_idNoA space id from list_spaces, to keep a document or an image in the space's Files rather than give it to one task.
size_bytesNoA video or sound: its exact size in bytes (wc -c < file), which the storage link is signed for.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / space_id / description
      Previous value: -"A space id from list_spaces, to keep a document in its Files or an image in its images rather than give it to one task."New value: +"A space id from list_spaces, to keep a document or an image in the space's Files rather than give it to one task."
  2. Changed1 schema field changed
    • addedInput schema / properties / size_bytes
      Added value: +{
      +  "description": "A video or sound: its exact size in bytes (wc -c < file), which the storage link is signed for.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / space_id
      Added value: +{
      +  "description": "A space id from list_spaces, to keep a document in its Files or an image in its images rather than give it to one task.",
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false, destructiveHint=false, openWorldHint=false, and the description adds the real behavioral profile: a 15-minute link lifetime, a 1-day deletion for uploads not used by a task, size caps of 20 MB/100 MB/200 MB/1 GB, required headers and size_bytes for video and sound, and the fact that a large scan takes minutes to read. Nothing here contradicts the annotations.

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?

The critical constraint (get a link, then PUT, 15-minute lifetime) is front-loaded, and nearly every sentence carries a distinct fact. It is long prose for a three-parameter tool, and the space_id branches repeat similar phrasing ('every chat in the space reads it' / 'every chat in the space can find it'), which makes it harder to scan than a short bulleted structure would.

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, the description itself explains the returns: JSON containing file_id, or image_id/media_id/space_file_id depending on space_id, plus reading: true for a long scan. Combined with the TTL, size limits, and multi-step curl guidance, an agent has everything needed to call this correctly on the first try.

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

Parameters5/5

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

Schema coverage is already 100%, but the description still adds meaning the schema cannot: size_bytes is mandatory specifically for video and sound because the storage link is signed for it, and space_id behaves completely differently depending on file type, yielding space_file_id, image_id, or media_id. That conditional logic is invisible in the schema and is exactly what the agent needs to interpret the parameters.

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 first sentence gives a concrete verb and resource: get an upload link to send one image, video, or document from disk for a task to work from. It immediately distinguishes the two-step flow (get link, then PUT) and names the downstream consumers (start_task, reply) as well as the space variants, so an agent can tell it apart from siblings like create_element or add_images.

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 is explicit about when to use it (upload an image or video right before the task that uses it), when to branch with space_id (keep a document or image in a space's Files instead of one task), and which siblings take over afterward (add_images for collections, pin for required reading, create_element for media). It also warns when not to over-upload: about 20 can wait unsent and waiting ones block the human's own uploading.

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.

Resources