Skip to main content
Glama

Finalize media upload

finalize_media_upload

Record an uploaded file as a media file after the browser PUT (pairs with create_media_upload; used by the composer UI). Use this when a presigned direct upload finished and the file must be registered (advanced).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
r2KeyYesThe r2Key returned by create_media_upload.
widthNoPixel width (images/video).
heightNoPixel height (images/video).
durationNoDuration in seconds (video).
fileNameYesOriginal file name.
mimeTypeYesFile MIME type.
sizeBytesYesFile size in bytes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "file": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "properties": {
      +            "filename": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "id": {
      +              "anyOf": [
      +                {
      +                  "anyOf": [
      +                    {
      +                      "type": "number"
      +                    },
      +                    {
      +                      "type": "string"
      +                    }
      +                  ]
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "url": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already state the tool is not read-only and not destructive, leaving the mutation nature clear. The description adds that it pairs with create_media_upload and is used by the composer UI, but does not disclose potential side effects (like what happens if called twice) or any authentication requirements. With annotations covering the basic safety profile, a 3 is appropriate.

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?

The description is concise, with two sentences that front-load the core action and then provide usage guidance. No unnecessary words or repetition.

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?

The tool has an output schema, so return values are assumed to be documented there. The description clarifies the step in the upload flow and the advanced nature, which is sufficient for a well-defined tool in a pipeline. Minor missing detail: preconditions like having a valid presigned upload, but this is implied by pairing with create_media_upload.

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?

The schema has 100% coverage, so all parameters are described there. The description specifically mentions r2Key as returned by create_media_upload, which adds useful context, but does not explain the optional nature of width, height, and duration, or when they should be provided. This is adequate but not exhaustive.

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 clearly states the tool records an uploaded file as a media file after a browser PUT, and explicitly pairs it with create_media_upload. This makes the tool's purpose specific and distinguishes it from the sibling create_media_upload and upload_media, which are likely for different stages of the upload process.

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?

The description provides explicit guidance: 'Use this when a presigned direct upload finished and the file must be registered (advanced).' This tells the agent exactly when to invoke this tool and indicates it is for advanced scenarios, complementing create_media_upload which is the first step.

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