Skip to main content
Glama

Upload Media

upload_media

Upload media and get back a reusable media_id. Four 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), (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. (4) In ChatGPT, pass a file from the conversation (one the user attached, or an image you generated) as file: ChatGPT supplies its download link and the file goes straight into the media library, no size cap beyond 500MB and no manual upload. 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. A media_id stays available until the last post that uses it has published, then the file is deleted: reusing it across posts that are all scheduled is fine, but for a post created after those have gone out, upload the file again. 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

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.
fileNoChatGPT only: a file from this conversation (attached by the user or generated by you). ChatGPT fills in download_url and file_id. Provide only `file`, not `url`/`data`/`size_bytes`.
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. Changed1 schema field changed
    • addedInput schema / properties / file
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "ChatGPT only: a file from this conversation (attached by the user or generated by you). ChatGPT fills in download_url and file_id. Provide only `file`, not `url`/`data`/`size_bytes`.",
      +  "properties": {
      +    "download_url": {
      +      "description": "Temporary download link ChatGPT provides for the file.",
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "description": "ChatGPT's id for the file.",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "type": "object"
      +}
  2. 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"
      +}
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, open-world write, so the safety profile is covered. The description adds substantial context the annotations cannot: media_id lifecycle (deleted after the last using post publishes), presigned URL validity of 2 hours, the 3MB vs 500MB caps, and the format restrictions. It does not describe failure behavior or auth requirements, keeping it short of a 5.

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-loaded with the purpose and media_id outcome before the mode breakdown, and every sentence carries operational detail (caps, validity windows, alternatives). It is dense and long, but there is little filler; only the PDF/LinkedIn aside is somewhat incidental to the upload task.

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?

With no output schema, the description takes on the burden of explaining return values and it does so: media_id, presigned upload_url, and an included curl command. Combined with the caps, lifecycle, and downstream usage guidance, an agent has everything needed to call this correctly.

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 baseline is 3. The description goes beyond the schema by explaining the mode-combination logic, i.e. which parameters pair with which (size_bytes + mime_type + name with no url/data), the 3MB and 500MB caps, and what each mode returns. That is meaningful semantics layered on top of schema-documented 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 the specific verb (upload) and resource (media), and immediately names the concrete outcome: a reusable media_id. It also enumerates four distinct invocation modes, which is far more than a restatement of the name.

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 routes the agent by environment and input: mode 1 for URLs, mode 2 for small base64 data, mode 3 for local files when shell commands are available, mode 4 for ChatGPT conversation files. It names exclusions (HEIC not supported) and a fallback alternative (request_upload_link) when neither mode fits.

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.