Skip to main content
Glama

Upload a local file (step 1 of 2)

create_media_upload

For a file on your machine that has no public URL: reserves the space and returns media_id and a signed upload_url. PUT the file's raw bytes there with exactly the returned headers (content-type, content-length, if-none-match: *) within 30 minutes, then call complete_media_upload with the media_id; until then the media can't go on a post. The file goes straight to Shager's storage, not through this API. Types: JPEG, PNG, WebP, GIF, MP4, MOV, WebM and PDF, up to 2 GB; size_bytes must be the file's exact size. For a file that is already online, upload_media_from_url does it in one call. A video file is deleted 7 days after the time of the posts that use it (a still stays); to post it again later, upload it again.

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": {
      "workspace_id": "<workspace_id>",
      "file_name": "<file_name>",
      "mime_type": "<mime_type>",
      "size_bytes": "<size_bytes>"
    },
    "name": "create_media_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_nameYes
mime_typeYesThe file's type: image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime (MOV), video/webm or application/pdf
size_bytesYesThe file's exact size in bytes
workspace_idYesWorkspace id from list_workspaces

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the out-of-band mechanics: the bytes are PUT directly to the returned signed URL with exact headers (content-type, content-length, if-none-match: *), not through this API. It adds a hard 30-minute expiry window, a 2 GB cap, and a retention rule that videos are deleted 7 days after the posts using them while stills persist — none of which appear in the annotations.

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

Conciseness4/5

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

Front-loads the purpose and the returned identifiers, then packs constraints and the alternative into a tight block with no filler. It loses a point for restating the mime-type list that the enum already enumerates, which is the one clearly redundant stretch.

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?

There is no output schema, so the description correctly explains the return payload (media_id plus signed upload_url) and the exact procedure for consuming it. For a non-idempotent, non-destructive reservation step it covers prerequisites, constraints, follow-up, and cleanup behavior with nothing an agent needs left out.

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 coverage is 75% and the mime_type enum and size_bytes meaning are already documented in the schema; the description largely restates the allowed type list and the 'exact size' requirement. It adds the 2 GB ceiling as prose and ties file_name implicitly to the local file, but contributes little new parameter meaning beyond the structured fields.

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 ('reserves the space and returns media_id and a signed upload_url') and frames it as step 1 of a two-step flow. It explicitly distinguishes itself from both siblings in the flow: complete_media_upload for the finish and 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?

Gives the selecting condition up front ('a file on your machine that has no public URL') and names the alternative path ('For a file that is already online, upload_media_from_url does it in one call'). It also states the required follow-up call and the consequence of skipping it ('until then the media can't go on a post').

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