Skip to main content
Glama

upload_media

Upload media and get back a reusable media_id. Three modes: (1) pass url to upload from a publicly accessible URL, (2) pass data (base64-encoded file bytes) plus mime_type for small files (3MB cap), or (3) for a file on the user's machine when you can run shell commands (Claude Code, Cowork, Codex, Cursor), pass size_bytes plus mime_type and name with no url or data: you get a media_id and a presigned upload_url, then PUT the raw file to it yourself (curl command included in the result, valid 2 hours, up to 500MB, no 3MB cap). Use mode 3 for any local video. Supports images (PNG/JPEG), videos (MP4/MOV), and PDFs (application/pdf). A PDF returns a document-kind media_id — pass it to create_post on a LinkedIn account to publish a native LinkedIn document post (PDF carousel); set platform_configurations.linkedin.document_title to control the title. Use the returned media_id with the media param on create_post/update_post. HEIC/HEIF images are not supported — convert to JPEG or PNG first. Direct data uploads are capped at 3MB raw because of serverless request-body limits — for larger local files use mode 3 if you can run commands, otherwise request_upload_link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublicly accessible URL of the image or video to upload. Provide either `url` or `data`, not both.
dataNoBase64-encoded file contents. Requires `mime_type`. Capped at 3MB raw (serverless request-body limit). For larger files, host the file at a public URL and pass it as `url` instead. Provide either `data` or `url`, not both.
nameNoOptional filename to store (defaults to the URL's filename, or 'file' for direct uploads)
mime_typeNoRequired with `data` or `size_bytes`. One of: image/png, image/jpeg, video/mp4, video/quicktime, application/pdf.
size_bytesNoMode 3: exact size of the local file in bytes (e.g. from `stat` or `wc -c`). With `mime_type` and `name`, and no `url`/`data`, returns a presigned upload_url to PUT the file to yourself. Max 500MB.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / mime_type / description
      Previous value: -"Required when using `data`. One of: image/png, image/jpeg, video/mp4, video/quicktime, application/pdf."New value: +"Required with `data` or `size_bytes`. One of: image/png, image/jpeg, video/mp4, video/quicktime, application/pdf."
    • addedInput schema / properties / size_bytes
      Added value: +{
      +  "description": "Mode 3: exact size of the local file in bytes (e.g. from `stat` or `wc -c`). With `mime_type` and `name`, and no `url`/`data`, returns a presigned upload_url to PUT the file to yourself. Max 500MB.",
      +  "exclusiveMinimum": 0,
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover safety hints (readOnlyHint=false, destructiveHint=false, openWorldHint=true). The description adds substantial behavior beyond that: 3MB serverless body cap, 500MB presigned limit, 2-hour URL validity, HEIC/HEIF rejection, PDF producing a document-kind media_id with LinkedIn carousel semantics, and the curl command returned in the result.

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?

Dense but front-loaded: the core purpose and the three modes come first, then format support, then downstream usage. Nearly every clause carries information, though the mode enumeration is long enough that a reader must parse carefully.

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?

No output schema exists, yet the description explains what is returned (media_id, presigned upload_url, included curl command) and how to use it downstream. Supported and unsupported formats, size limits, and the LinkedIn PDF path are all covered, leaving no operational gap.

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 already 100%, so the baseline is 3. The description goes further by grouping parameters into named modes and spelling out cross-parameter rules (url XOR data; size_bytes requires mime_type and name and forbids url/data), which is genuine added meaning over the per-field schema text.

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+resource ('Upload media and get back a reusable media_id') and immediately distinguishes the three input modes. It also names the downstream consumer (create_post/update_post `media` param) and the relevant sibling request_upload_link, so an agent can place it precisely among siblings.

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?

Explicit routing rules: mode 1 for public URLs, mode 2 for small base64 files (3MB cap), mode 3 for local files when shell commands are available, plus 'Use mode 3 for any local video' and 'otherwise request_upload_link'. Both the when and the fallback alternative are named.

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.