Skip to main content
Glama

get a media upload url

assets_create-upload-url
Destructive

Get a presigned upload URL for a local audio, video, or image file so you can upload its bytes and register the media as an asset.

Instructions

Get a presigned upload URL for a local audio, video or image file: step 1 of 2 for media that is not already at a public URL. PUT the raw bytes to the returned uploadUrl with exactly the declared Content-Type and byte size, then pass the returned url (not uploadUrl) to assets_create to register the asset; until then no asset exists. Not for a public https:// file or a social video link (pass those straight to assets_create), or for re-hosting an already saved video as an Edit Dialogue source (dialogue_upload-source, when available). Returns {uploadUrl, url, expiresIn}: expiresIn is the upload URL's lifetime in seconds; if it expires, request a new one. Spends no credits. Each call issues a new storage path behind a random prefix, so it never collides with an existing file; request a separate upload URL for each file. For example, it returns 422 when size exceeds your plan's upload limit, and assets_create returns 422 if nothing was uploaded.

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>",
      "contentType": "<contentType>",
      "size": "<size>"
    },
    "name": "assets_create-upload-url"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeYesExact file size as a whole number of bytes, up to 5GB; the PUT must send exactly this many bytes. Your plan's size limit is checked against it here, and again by assets_create on the uploaded file.
fileNameYesName of the local file with its extension, up to 255 characters. It only names the stored file: the extension is kept (lowercased), spaces become underscores and other special characters may be dropped.
contentTypeYesMIME type starting with audio/, video/ or image/, such as video/mp4; send the same value as the Content-Type header on the PUT.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.4
    • changedInput schema / properties / contentType / description
      Previous value: -"MIME type of the file, such as video/mp4; send the same value when you PUT it."New value: +"MIME type starting with audio/, video/ or image/, such as video/mp4; send the same value as the Content-Type header on the PUT."
    • changedInput schema / properties / fileName / description
      Previous value: -"Name of the local file, with its extension."New value: +"Name of the local file with its extension, up to 255 characters. It only names the stored file: the extension is kept (lowercased), spaces become underscores and other special characters may be dropped."
    • changedInput schema / properties / size / description
      Previous value: -"File size in bytes."New value: +"Exact file size as a whole number of bytes, up to 5GB; the PUT must send exactly this many bytes. Your plan's size limit is checked against it here, and again by assets_create on the uploaded file."
  2. Changed3 schema fields changed
    • addedInput schema / properties / contentType / description
      Added value: +"MIME type of the file, such as video/mp4; send the same value when you PUT it."
    • addedInput schema / properties / fileName / description
      Added value: +"Name of the local file, with its extension."
    • addedInput schema / properties / size / description
      Added value: +"File size in bytes."
  3. Changed2 schema fields changedv0.1.5
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observedv0.1.4

TDQS

A4.6/5.0
Behavior5/5

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

The annotations only say the call is non-read-only, non-idempotent, open-world and destructive; the description supplies everything else of consequence: that nothing is registered until assets_create runs, that the returned url (not uploadUrl) is what gets passed on, that expiresIn is a lifetime in seconds after which a new URL must be requested, that no credits are spent, and that each call mints a fresh random-prefix path so it can never collide. It also discloses failure modes (422 from this tool vs 422 from assets_create when nothing was uploaded).

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 verb and the 'step 1 of 2' framing, and nearly every clause carries non-redundant information (alternatives, return fields, expiry, error codes). It is a single dense block of roughly 150 words, which is justified by the two-step workflow but costs some scannability.

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 carries the return contract itself ({uploadUrl, url, expiresIn} with each field's meaning) and adds the downstream hand-off and the 422 conditions. For a non-idempotent, non-read-only tool operating in an open-world storage flow, 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 description coverage is 100%, so fileName, contentType and size are already fully documented, including the 5GB bound, extension normalization and the Content-Type header requirement. The description restates the Content-Type and byte-size constraint in the PUT step but adds no new parameter semantics beyond what the schema already carries, 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 verb and resource ('Get a presigned upload URL for a local audio, video or image file') and immediately frames it as 'step 1 of 2' of a named workflow, so an agent knows exactly what it produces and that no asset exists yet. It also draws the boundary against assets_create and dialogue_upload-source in the same paragraph, which is stronger differentiation than most siblings in this list provide.

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 names the when-not cases: not for a public https:// file or social video link (pass those straight to assets_create) and not for re-hosting an already saved video as an Edit Dialogue source (use dialogue_upload-source). It also gives the positive condition — local file, one upload URL per file — so both branches of the decision are covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.