Skip to main content
Glama

Finalize Upload

finalize_media_upload

Finalize a presigned URL media upload. Call after uploading to the upload_url from upload_media, or after PUTting bytes directly to an upload_url minted by get_media_upload_url. Needs only { asset_id, domain } plus the same MCP/API token already on this session — no browser or cookie. Validates the file and processes dimensions/thumbnails — for a PDF that means rasterizing page one into a badged thumbnail. Bytes that are not really a PDF are rejected; a genuine PDF that will not rasterize still finalizes, just without a preview.

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": {
      "asset_id": "<asset_id>",
      "domain": "<domain>"
    },
    "name": "finalize_media_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoYour name, on every write: Duet/<channel name> or Grok Bot/<bot name>.
domainYes
asset_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only supply destructiveHint=false, so the description carries the rest and does so well: it states auth requirements (session token, 'no browser or cookie'), what processing happens (validation, dimensions, thumbnails, PDF page-one rasterization), the rejection condition for fake PDFs, and the graceful fallback where a genuine but unrasterizable PDF still finalizes without a preview.

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 action and the call ordering, then escalation to processing details. Every sentence is informative, though the PDF rasterization clause is longer than strictly necessary for tool selection.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 should hint at the outcome, and it does indirectly (dimensions/thumbnails/preview state), but never states what the call returns or whether re-finalizing the same asset is idempotent. For a mutation-adjacent finalize step, that is a modest remaining gap against otherwise strong coverage.

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 only 33%, and the description partially compensates by scoping the requirement to '{ asset_id, domain }' and treating the token as ambient rather than a parameter. However, it never explains where asset_id comes from or what domain denotes, so the two required fields remain semantically thin.

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: 'Finalize a presigned URL media upload.' It immediately distinguishes the tool from the two siblings it names (upload_media, get_media_upload_url), so an agent knows this is the completion step rather than the URL-minting or byte-upload step.

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?

Gives explicit ordering and both valid entry paths: 'Call after uploading to the upload_url from upload_media, or after PUTting bytes directly to an upload_url minted by get_media_upload_url.' It names the upstream alternatives and the condition that selects each, leaving nothing to inference about sequencing.

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.