Skip to main content
Glama

files_create_upload_url

Get a URL to upload a local file DIRECTLY to storage, without passing its bytes through this conversation.

Use this for any file you already have on disk — it is the only way to send one without spending tokens on its contents, and the only way to send anything above ~50 KB at all.

Three steps:

  1. files_create_upload_url(filename, mime_type, size_bytes, sha256)

  2. curl -X PUT --data-binary @/path/to/file <upload_url> (send every header from headers verbatim)

  3. files_complete_upload(file_id) -> the file is ready

Pass sha256 when you can: if the workspace already holds that exact file you get its file_id back immediately with deduplicated=true and no upload at all.

Returns: file_id, upload_url, method, headers, expires_at.

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>",
      "size_bytes": "<size_bytes>"
    },
    "name": "files_create_upload_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNoOptional display title
sha256NoHex sha256 of the file (`sha256sum <path>`). Optional but recommended: enables dedup and verifies the upload arrived intact.
filenameYesFilename with extension (e.g. 'photo.jpg')
mime_typeNoMIME type (e.g. 'image/jpeg'). Guessed from the filename when omitted.
size_bytesYesEXACT byte length of the file (`stat -c %s <path>`). Checked before anything is transferred, so an oversize file is refused here rather than after the upload. Limit: 2 GB (100 MB in a workspace whose own storage cannot issue an upload URL; the refusal says so). A file over 100 MB is stored and can be sent, downloaded or passed on by its file_id, but is not indexed for search.
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / size_bytes / description
      Previous value: -"EXACT byte length of the file (`stat -c %s <path>`). Checked before anything is transferred, so an oversize file is refused here rather than after the upload. Limit: 100 MB."New value: +"EXACT byte length of the file (`stat -c %s <path>`). Checked before anything is transferred, so an oversize file is refused here rather than after the upload. Limit: 2 GB (100 MB in a workspace whose own storage cannot issue an upload URL; the refusal says so). A file over 100 MB is stored and can be sent, downloaded or passed on by its file_id, but is not indexed for search."
  2. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  3. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only say it is a non-read-only, non-destructive, non-idempotent write with no open-world access. The description adds substantial unannotated behavior: a two-phase upload with a PUT step, mandatory verbatim header forwarding, URL expiry, a dedup short-circuit that returns file_id with deduplicated=true and skips the upload entirely, and the 2 GB / 100 MB storage limits with the non-indexing consequence above 100 MB.

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?

Front-loads the core distinction in one sentence, then uses a numbered three-step protocol and a returns line. The length is justified by a multi-call workflow; no sentence is filler.

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?

There is no output schema, but the description enumerates the return fields (file_id, upload_url, method, headers, expires_at) and the dedup variant, which is exactly what an agent needs to chain into files_complete_upload. Size limits and failure modes are covered, so nothing material is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description earns above baseline by explaining the payoff of sha256 (dedup plus integrity verification) in workflow terms rather than just restating the field. The remaining parameters, including in_workspace, are left entirely to the schema.

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 ('Get a URL to upload a local file DIRECTLY to storage') and immediately delimits the scope against the sibling that streams bytes ('without passing its bytes through this conversation'). An agent can distinguish this from files_upload or browser_file_upload without opening either schema.

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 routing: 'use this for any file you already have on disk', flagged as 'the only way to send one without spending tokens' and 'the only way to send anything above ~50 KB at all'. It also lays out the exact three-call sequence and names the follow-up tools (files_complete_upload) required for the file to become usable.

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.