Skip to main content
Glama

Start a direct media upload

create_media_upload

Get a presigned URL to upload a file straight to storage — no base64 through this channel, no third-party host. Best for large files and production. The URL grants write access to this workspace’s own private storage for 10 minutes; it replaces nothing, and the file joins the media library only when attach_media records it. Flow: (1) call this with the contentType; (2) HTTP PUT the raw file bytes to the returned uploadUrl (e.g. curl -X PUT --data-binary @file -H "Content-Type: <type>" "<uploadUrl>"); (3) call attach_media with the returned storageKey to save it to the media library.

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": {
      "contentType": "<contentType>"
    },
    "name": "create_media_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameNoOriginal filename (for a nicer storage key)
contentTypeYesMIME type of the file, e.g. image/jpeg, image/png, video/mp4
workspaceIdNoWhich workspace to act in — an id from list_workspaces. Optional with a single workspace; REQUIRED once there are several, where guessing would mean posting one client's content to another client's accounts. Ask the user which one before publishing.

Output Schema

NameRequiredDescriptionDefault
nextNo
uploadUrlNo
storageKeyNo
expiresInSecNo

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?

Beyond the annotations, the description discloses important behavior: the URL grants write access only to this workspace’s private storage, expires after 10 minutes, replaces nothing, and the file only enters the media library after attach_media records it. It also explains the expected HTTP PUT flow and returned 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?

The definition is front-loaded with the core purpose, then gives a compact numbered flow and a concrete curl example. Despite covering a multi-step upload process, every sentence provides useful operational context.

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?

An output schema exists, so the description does not need to enumerate return values, but it still mentions uploadUrl and storageKey meaningfully within the workflow. It covers the time limit, storage scope, non-replacement behavior, and the required attach_media follow-up.

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%, so the schema already documents contentType, filename, and workspaceId in detail. The description reinforces contentType and the uploadUrl/storageKey flow, but it does not add meaning beyond the schema for the input parameters themselves.

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 states a specific verb and resource: obtaining a presigned URL to upload a file directly to storage. It also distinguishes the approach from base64 uploads and third-party hosts, and identifies the intended use case of large files in production.

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?

It clearly frames when this tool is appropriate: large files and production use, with an explicit three-step flow and a required follow-up call to attach_media. It does not explicitly compare against the sibling upload_media tool, so the alternative-selection guidance is strong but not complete.

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.