Skip to main content
Glama

Finalize Media Upload

finalize_media_upload

Step 2 after create_media_upload_url and the PUT: checks the file arrived, is within the declared size and really is a supported video/image (by its bytes), stores it in the user's account and returns its mediaId and permanent public URL. Safe to call again — a finished upload returns the same result. A file that fails the checks is discarded. Output: { mediaId, status: 'ready', url, kind, contentType, sizeBytes, filename }.

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

Input Schema

NameRequiredDescriptionDefault
mediaIdYesThe mediaId returned by create_media_upload_url

Output Schema

NameRequiredDescriptionDefault
urlYesPermanent public URL of the stored file
kindYes
statusYes
mediaIdYesOpaque id (med_…) — pass it to create_post_from_video
filenameYes
sizeBytesYesStored size in bytes
contentTypeYesContent type detected from the stored bytes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior2/5

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

Rich on validation behavior: it checks byte-level file type, enforces the declared size, discards failing files, and scopes storage to the user's account. However, 'Safe to call again — a finished upload returns the same result' directly contradicts the annotation idempotentHint=false, which tells the agent repeated calls may have additional effects. An agent trusting the prose could retry where the annotation warns against it.

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-loaded with the pipeline position, then validation rules, then retry/failure behavior, then the return shape. Nearly every clause carries new information and none is redundant with the schema or annotations.

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 an output schema present, the description does not need to explain return values in depth, yet it still names the key fields. It covers the preconditions (upload PUT must have happened), failure handling, and account scoping — leaving no operational gap for a single-parameter tool.

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 single parameter (mediaId) is already documented as coming from create_media_upload_url. The description reinforces the ordering but adds no new syntax, format, or constraint detail beyond the structured schema, 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 ('checks the file arrived... stores it in the user's account') and anchors it in the workflow as 'Step 2 after create_media_upload_url and the PUT'. An agent can distinguish it from create_media_upload_url, upload_file, and import_media_from_url without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit sequencing: it is the step that runs after create_media_upload_url and the PUT, and tells the agent it is safe to re-call on an already-finished upload. It does not name an alternative or a when-not-to-use case, but for a mandatory pipeline step the ordering guidance is unambiguous.

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