Skip to main content
Glama

Finalize Upload

finalize_upload

Finalize a direct upload once you have PUT the bytes to the uploadUrl from create_upload. Confirms the bytes landed and starts ingest: image/asset become ready immediately (status "complete"); audio/video enter processing (status "processing"). Returns { id, status, processingPhase }. 400 if no bytes were uploaded (PUT first) or the item is not yours. Then call wait_job(kind="media", id=mediaItemId), or use a media.completed webhook.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesPOST /media/:id/finalize body — optional declared audioRole.
mediaItemIdYesmediaItemId (path).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
statusNo
processingPhaseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare only the generic safety profile (not read-only, not destructive, not idempotent); the description adds behavior they don't capture — state transitions (image/asset -> 'complete' immediately, audio/video -> 'processing'), the exact 400 failure modes (no bytes PUT, item not owned), and the returned shape. This is meaningful disclosure beyond the structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the action and its precondition, then the behavioral outcome, then the error cases, then the next step. Every sentence carries distinct operational information; there is no 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?

For a pipeline-mutating tool with rich annotations and an output schema, the description covers everything an agent needs: prerequisite, state effects, failure conditions, and the correct follow-up call. It even restates the return shape, which already exists as an output schema.

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% and the schema already documents both mediaItemId and the optional audioRole enum with rich semantic detail. The description adds no parameter-level meaning of its own, so the baseline of 3 for a fully-covered schema 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+resource ('Finalize a direct upload') and pins its place in the pipeline relative to create_upload. It also names its difference from sibling flows (asset/image vs. audio/video handling), so an agent can distinguish it without opening a 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?

Gives the explicit precondition ('once you have PUT the bytes to the uploadUrl from create_upload') and names the follow-up alternatives ('call wait_job(kind="media", id=mediaItemId), or use a media.completed webhook'). It also names when it fails, so the agent knows what NOT to do out of order.

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.