Skip to main content
Glama

prepare_media_upload

STEP 1 of the media upload flow (use this for any real image/video, see upload_media only for tiny files). Returns a short-lived PRESIGNED upload URL you PUT the raw file bytes to yourself, outside MCP, with NO credentials (the signature is in the URL). Then call finalize_media_upload to register it and get the hosted publicUrl for schedule_post mediaUrls.

Flow:

  1. prepare_media_upload { filename, contentType, size } -> { key, uploadUrl, publicUrl }

  2. PUT the bytes to uploadUrl, e.g. curl -X PUT --data-binary @day01.mp4 -H "Content-Type: video/mp4" "<uploadUrl>". Do NOT base64-encode; send raw bytes.

  3. finalize_media_upload { key, contentType, size } -> registers the MediaAsset.

  4. Use the publicUrl in schedule_post mediaUrls.

size must be the exact byte size of the file. The uploadUrl expires shortly, so PUT immediately after preparing (prepare/PUT/finalize one file at a time rather than preparing many up front). CAPABILITY: draft: creates content that cannot reach an audience on its own. Safe for a draft-only agent token.

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": "prepare_media_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeYesExact file size in bytes.
filenameYesOriginal filename incl. extension, e.g. "day01.mp4".
contentTypeYesMIME type of the file, e.g. image/jpeg or video/mp4. Must match the Content-Type you use for the PUT.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / contentType / description
      Previous value: -"MIME type: image/jpeg|image/png|image/gif|image/webp|video/mp4|video/quicktime."New value: +"MIME type of the file, e.g. image/jpeg or video/mp4. Must match the Content-Type you use for the PUT."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the generic read/write and open-world flags; the description adds substantial operational context they do not cover: the URL is short-lived and must be used immediately, the PUT happens outside MCP with no credentials because the URL is presigned, payloads must be raw bytes not base64, and the token's effective permission is scoped as a draft capability. That is exactly the kind of behavioral detail annotations cannot express.

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 key identity and constraint, then organized as a numbered four-step flow with an explicit return shape, which is easy to scan and act on. A few lines are mildly redundant with the schema (the exact-byte-size restatement), preventing a top score, but 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?

With no output schema, the description supplies the return shape ({key, uploadUrl, publicUrl}) itself, which is essential. Combined with the expiring-URL caveat, the out-of-band PUT mechanics, and the hand-off to finalize_media_upload and schedule_post mediaUrls, an agent has everything needed for a correct three-call flow.

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 goes beyond the schema by tying the parameters to a concrete invocation: the curl example shows that the supplied contentType must be sent as the PUT Content-Type header, and it repeats that size must be the exact byte count. This adds usable semantics about how the arguments are consumed downstream rather than merely restating field docs.

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 description opens with a specific verb+resource+position in a pipeline: 'STEP 1 of the media upload flow' that 'Returns a short-lived PRESIGNED upload URL.' It explicitly distinguishes itself from the sibling upload_media ('see upload_media only for tiny files'), so an agent can route between them without opening schemas.

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 gives explicit when-to-use ('use this for any real image/video') and when-not ('upload_media only for tiny files'), plus ordering constraints ('prepare/PUT/finalize one file at a time rather than preparing many up front') and a named next step (finalize_media_upload). Nothing about selection or sequencing is left to inference.

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.