Skip to main content
Glama

Upload a file to the media library

upload_media_file
Destructive

[Admin] Upload a file to the company's media library and return it, ready to use.

Sends the file (base64) and has it checked: its real type, the codec of a video, and anything active in an SVG, which is refused rather than cleaned. The returned file.url is what page blocks, brand logos and font settings take. The library is public: a file can be reached by anyone with its address. Switched on per company by JobMojito; while it is off this is refused with 403.

A file too large to pass as an argument goes through start_media_upload and finish_media_upload, for a client that can send a file to an address.

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": {
      "file": "<file>",
      "file_name": "<file_name>",
      "content_type": "<content_type>"
    },
    "name": "upload_media_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe file's bytes, base64-encoded. At most 50 MB once decoded.
widthNoWidth in pixels of an image or video.
folderNoLibrary folder, one level, such as Crew life (list_media_files include_folders=true gives the names). Default: the top. A new name makes the folder.
heightNoHeight in pixels of an image or video.
file_nameYesDisplay name in the library, such as team-photo.jpg. No slashes.
llm_modelNoYour model id, e.g. "claude-opus-4-8"; "unknown" if unsure. For analytics.
poster_urlNoFor a video: the url of an image already in this company's library, shown before it plays.
merchant_idNoOnly for an account acting for a sub-merchant; omit for your own company.
content_typeYesimage/jpeg, image/png, image/webp, image/gif, image/avif, image/svg+xml, video/mp4 (H.264 only), audio/mpeg, audio/mp4, audio/x-m4a or font/woff2.
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.
duration_secondsNoLength of a video or audio file in seconds.
replace_media_idNoReplace this file instead of adding one. It must be the same kind, and page drafts move to the new address.

Output Schema

NameRequiredDescriptionDefault
_mcp_instructionsNoServer-issued metadata for this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / content_type / enum
      Added value: +[
      +  "image/jpeg",
      +  "image/png",
      +  "image/webp",
      +  "image/gif",
      +  "image/avif",
      +  "image/svg+xml",
      +  "video/mp4",
      +  "audio/mpeg",
      +  "audio/mp4",
      +  "audio/x-m4a",
      +  "font/woff2"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Your model id, e.g. \"claude-opus-4-8\"; \"unknown\" if unsure. For analytics.",
      +  "type": "string"
      +}
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare the safety profile (destructive, non-idempotent, open-world), and the description adds genuinely new behavior: server-side validation of real type, video codec, and active SVG content that is refused rather than sanitized. It also discloses the exposure consequence (the library is public, any file reachable by URL) and the enablement/403 gate, none of which is 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.

Conciseness5/5

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

Front-loaded purpose in the first clause, then validation behavior, then exposure warning, then the alternative path — each paragraph carries a distinct decision-relevant fact with no filler. The [Admin] prefix telegraphs the access constraint before anything else.

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?

For a 12-parameter mutation tool with a rich schema and an output schema, the description covers the things structured fields cannot: verification behavior, refusal of active SVG content, public reachability, the tenancy gate, and the fallback tool chain. Nothing needed to invoke or interpret the call safely is missing.

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 100%, so parameters like replace_media_id and folder are already documented in detail; the description adds little parameter-level meaning. Its useful addition is downstream rather than parametric — that the returned file.url is what page blocks, brand logos and font settings consume — which is about the result, not the inputs.

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?

Specific verb and resource ("Upload a file to the company's media library and return it"), with the admin-only marker and the inline-vs-out-of-band split made explicit. An agent can distinguish it from start_media_upload and finish_media_upload without opening any 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 routing: use this tool when the file fits as an argument, use start_media_upload + finish_media_upload when it is too large to pass as an argument. It also states the deployment precondition (per-company switch; 403 while off), which tells the agent when the call will fail rather than succeed.

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.