Skip to main content
Glama

Start a file upload

create_upload_url

Start an upload for a file this server does not hold, and get back a URL to send the bytes to. Use it only from a client that can send the file's bytes itself with an HTTP PUT. A chat that cannot send an HTTP request should not call it, because the upload cannot finish without the bytes. Two steps are needed: PUT the bytes to the returned URL with exactly the headers it gives you, then call complete_upload with the id it returns. The link does not work until both have happened. The upload URL is valid for five minutes. If it lapses before the bytes land, call this again for a fresh one rather than reusing the id. size_bytes has to be the exact number of bytes you are about to upload, because it is signed into the URL and storage refuses a body of any other length. Use share_text instead when you already hold the text and want it published in a single call.

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

Input Schema

NameRequiredDescriptionDefault
filenameYesThe name to store the file under, including its extension. Up to 200 characters.
size_bytesYesThe exact number of bytes you are about to upload, as a whole number. This is signed into the upload URL, so a PUT whose body is even one byte longer or shorter is refused by storage. Measure the file rather than estimating.
content_typeYesThe MIME type of the bytes you are about to upload, such as application/pdf or image/png. Send this exact value as the Content-Type header on the PUT. Storage does not check it, so nothing will refuse a PUT that sends a different one. The type the link serves under is decided when the upload completes, from the first bytes of the file weighed against this value and the filename. A recognised file signature, such as a PDF or PNG header, wins over this value. HTML is kept as HTML only when this value is text/html. An image, PDF, HTML or ZIP type with no matching signature is stored as application/octet-stream. Otherwise this value stands, so send the true type.
desired_slugNoOptional. A preferred short name for the public link. It is cleaned up and checked on the server, and one that is taken or unusable is replaced with a random one rather than failing the call. The reply always names the slug that was actually assigned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / content_type / description
      Previous value: -"The MIME type of the bytes you are about to upload, such as application/pdf or image/png. Send this exact value as the Content-Type header on the PUT. Storage does not check it, so nothing will refuse a PUT that sends a different one. Send it anyway. This value is stored as the file's type and decides how the link serves the file, and a file stored as something its bytes are not is served wrongly."New value: +"The MIME type of the bytes you are about to upload, such as application/pdf or image/png. Send this exact value as the Content-Type header on the PUT. Storage does not check it, so nothing will refuse a PUT that sends a different one. The type the link serves under is decided when the upload completes, from the first bytes of the file weighed against this value and the filename. A recognised file signature, such as a PDF or PNG header, wins over this value. HTML is kept as HTML only when this value is text/html. An image, PDF, HTML or ZIP type with no matching signature is stored as application/octet-stream. Otherwise this value stands, so send the true type."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond annotations (readOnlyHint false, destructiveHint false, openWorldHint true) it discloses the multi-step lifecycle (PUT the bytes, then call complete_upload), that the link is dead until both steps complete, a five-minute URL expiry with the correct recovery (call again rather than reuse the id), and that size_bytes is signed so storage rejects mismatched bodies. That is exactly the operational context annotations cannot carry.

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?

Front-loaded with the outcome and the two-step flow, then preconditions, then expiry, then parameter caveats. A few sentences restate the same point ("the upload cannot finish without the bytes" vs. "The link does not work until both have happened"), so it is slightly longer than necessary but every section is on-topic.

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, and the description compensates by describing what comes back (a URL, an id, an assigned slug) and how to consume it. For a mutation tool with four fully documented parameters, nothing an agent needs in order to call it 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 coverage is 100%, so the baseline is 3. The description's size_bytes explanation (exact byte count, signed into the URL) largely restates the schema rather than extending it, and it says nothing new about filename or content_type; the only added nuance is that the reply always names the assigned slug when desired_slug is replaced, which the schema also notes.

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?

Names a specific verb and resource ("Start an upload ... get back a URL") and immediately constrains it to files "this server does not hold", which separates it from share_text and complete_upload. An agent can tell what it produces (a URL plus an id) without reading the 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?

Explicitly states the precondition (the client must be able to send an HTTP PUT) and an exclusion ("A chat that cannot send an HTTP request should not call it"). It also names the alternative and the condition that selects it: "Use share_text instead when you already hold the text and want it published in a single call."

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.