Skip to main content
Glama

media_upload_link

Creates a single-use link for uploading ONE media file into the media library. Call it when the user has a LOCAL file for a Riddle: this server cannot receive bytes, so the upload is yours. A link expires after 5 minutes, dies on first use (successful or not), and only 20 are handed out per account per 5 minutes - so create one immediately before each upload, a batch one file at a time rather than the links up front, and never store or share one. Check the file BEFORE minting a link, since a link a rejected file burns is gone: an image, a video or an audio file, at most 10 MB (some environments cap lower - "maxBytes" and "allowedTypes" in the answer are the authoritative pair). Pass the "project" you will build in. Returns {uploadUrl, expiresAt (UTC), singleUse, maxBytes, allowedTypes, project, usage, requiresNetworkAccessTo}. POST the file to "uploadUrl" as multipart/form-data under the field name "file" - "usage" is that command ready to run, e.g. curl -F 'file=@/path/to/image.png' '' (the link carries its own signature, so no API key or header). That POST leaves your environment and needs outbound HTTPS to the host in "requiresNetworkAccessTo" (allowlist the wildcard it gives; in Claude only an admin can change that organization setting). If it is blocked or does not resolve, tell the user which host to allow - do not retry or look for another way in. The POST answers with {mediaId, type, width, height, size, folderId, project}: "mediaId" is the ONLY handle - use it as "media": {"type": "Image", "mediaId": } in a block (riddle://reference/riddle-builder/block-types). Never guess a url for it: a CDN url passed as a plain "url" media is re-downloaded as a second, unrelated copy - the account pays twice and this file records no usage, which makes an image in a live Riddle look safe to delete. The file lands in the account's "AI Uploads" folder tagged "AI Upload", counts against their storage, and media_delete removes it again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoProject ID; NULL or omitted: your personal project (project API key: its project). A mediaId only resolves in its project - build in the same one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / project
      Added value: +{
      +  "default": null,
      +  "description": "Project ID; NULL or omitted: your personal project (project API key: its project). A mediaId only resolves in its project - build in the same one.",
      +  "type": [
      +    "null",
      +    "integer"
      +  ]
      +}
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only establish readOnly=false and destructive=false; the description adds the operational profile those fields cannot: 5-minute expiry, death-on-first-use even on failure, a 20-per-account/5-minute rate limit, outbound-HTTPS/allowlist requirements, storage accounting, 'AI Uploads' folder placement, and cleanup via media_delete. Far beyond annotation coverage and no contradiction (the POST is the agent's action, not the tool's, so openWorldHint=false is consistent).

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?

Length is large and some sentences are run-on, but it is strongly front-loaded (purpose, then trigger, then lifecycle rules, then return, then the exact POST command) and nearly every clause carries decision-relevant information. Slight redundancy in restating the expiry/single-use rules twice.

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, so the description carries the full return contract and does: shape of the mint response ({uploadUrl, expiresAt, singleUse, maxBytes, allowedTypes, project, usage, requiresNetworkAccessTo}) and of the POST response ({mediaId, type, width, height, size, folderId, project}), plus the exact multipart field name. Auth (signed link, no API key), error handling, and the mediaId-only rule are all covered.

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. The description adds a practical framing beyond the schema ('Pass the "project" you will build in') and reinforces the correctness constraint that a mediaId only resolves in the project it was built in. Modest but real added value over the structured field.

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?

Opens with a specific verb+resource+scope: 'Creates a single-use link for uploading ONE media file into the media library.' The 'single-use' qualifier and the ONE/SINGLE framing distinguish it sharply from the media_delete sibling and from any direct-upload 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?

Explicitly names the triggering condition ('when the user has a LOCAL file for a Riddle: this server cannot receive bytes, so the upload is yours'), states when-not-to-act ('do not retry or look for another way in'), and gives sequencing rules (one link immediately before each upload, never batch or store them, never guess a url). Alternatives and their failure modes are named.

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