Skip to main content
Glama

PostFlow

Init media upload

init_media_upload

Starts a direct upload of a local file and returns a pre-signed upload URL valid for one hour. Send the raw file bytes with an HTTP PUT request to upload_url including the upload_headers, then call complete_media_upload with the media_id. Supported extensions: jpg, jpeg, png, gif, webp, heic, avif, pdf, srt, mp4, mov, mpeg, webm, avi, mp3. Maximum size 5 GB. For a file that already has a public URL use upload_media_from_url instead.

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": {
      "file_name": "<file_name>",
      "size": "<size>"
    },
    "name": "init_media_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeYesExact file size in bytes, it is checked against the uploaded file.
file_nameYesFile name with extension, e.g. photo.jpg.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false. The description adds rich behavioral context: the upload URL is valid for one hour, raw bytes must be sent via HTTP PUT including upload_headers, and the next call should be complete_media_upload. It also lists supported extensions and a 5 GB size limit.

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 action and return value, then the upload workflow, then constraints and an alternative. Every sentence is informative, and the extension list is long but necessary for correct usage.

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?

Covers the full upload lifecycle: initiation, raw byte PUT, and completion via complete_media_upload. Constraints and alternatives are included. No output schema exists, but the description sufficiently explains return data and next steps.

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 parameters are already well documented. The description adds a whitelist of supported file extensions and restates the 5 GB maximum size, providing extra validation constraints beyond the schema.

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 (Starts a direct upload) and resource (local file), and describes the return (pre-signed upload URL). It explicitly distinguishes from sibling upload_media_from_url for files that already have a public URL.

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?

Explicitly says to use this for local files and names upload_media_from_url as the alternative when a public URL exists. It also provides the follow-up step of calling complete_media_upload with the media_id.

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