Skip to main content
Glama

Upload an image

upload_media_file

Upload one image into a media source, as base64. Best for something you generated — an SVG you wrote, a small chart. The bytes travel through your own context, so keep it under about 256 KB; for files already on a disk — a folder of photographs — use create_media_upload_link instead if you can run a shell command. For files the user attached to the conversation, do not re-encode them here: give the user the library's uploadInAppUrl (from list_workspace_sources or create_media_source) and let them drop the files in. Hard limit 4.0 MB. Any image type except GIF, which has no meaning in a print layout.

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": {
      "mediaSourceId": "<mediaSourceId>",
      "filename": "<filename>",
      "contentBase64": "<contentBase64>",
      "llm_model": "<llm_model>"
    },
    "name": "upload_media_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFolder path inside the library, e.g. "/products/". Created if missing. Defaults to the root.
filenameYesThe file name including extension — the extension decides the type.
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess.
contentBase64YesThe image's bytes, base64-encoded, with no data: prefix.
mediaSourceIdYesThe library to upload into, from list_workspace_sources.
conversation_idNoPass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only say this is a non-readonly, non-destructive write. The description adds the traits that actually matter: bytes transit the model's own context, a ~256 KB practical ceiling versus a 4.0 MB hard limit, and the GIF exclusion. These are operating constraints an agent cannot derive from the annotations or schema.

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 action and format, then the size ceiling, then the two escape hatches — a sensible priority order with strong emphasis markers on the failure-prone parts. It is dense but nearly every clause carries a distinct constraint; only the GIF remark feels marginally tangential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter write tool with a fully documented schema and no output schema, the description covers the risky decisions: size, type, and the correct alternative for each input origin. It doesn't say what comes back (file id or path) needed to chain into update_file or attach_media_source, which is the one real omission.

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, but the description adds real semantics for contentBase64 by tying it to the context-transit cost and suggesting the ~256 KB practical size. It does not add anything for path, filename, mediaSourceId, or conversation_id beyond what the schema already documents.

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?

Opens with a specific verb, resource, and transport format: 'Upload one image into a media source, as base64.' It also demarcates scope ('one image') and names the sibling it is not (create_media_upload_link), so an agent can route between them without opening either schema.

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 explicit when-to-use ('something you generated — an SVG you wrote, a small chart'), explicit when-not-to (files on disk → create_media_upload_link if a shell is available; user-attached files → don't re-encode, hand over uploadInAppUrl), and names where the URL comes from. The alternative routes are concrete and actionable.

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