Skip to main content
Glama

Upload Media from Base64

upload_media_from_base64

Last resort for small files: upload a file sent as a base64-encoded string. Prefer, in order: upload_attached_file for files the user attached in this chat (ChatGPT); create_upload_url + finish_upload if you can run shell commands (curl); open_upload_box to let the user pick files from their device; upload_media_from_url for public links. The file is stored exactly as received, without compression or resizing.

Max size: 7MB. Supports: JPEG, PNG, GIF, WebP, MP4, MOV, PDF. Returns a media ID that can be attached to a post.

Input Schema

NameRequiredDescriptionDefault
dataYesBase64-encoded file content (raw base64 or a data URI)
filenameYesFilename with extension (e.g. "photo.jpg")
mimeTypeYesMIME type of the file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / data / description
      Previous value: -"Base64-encoded file content"New value: +"Base64-encoded file content (raw base64 or a data URI)"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false) by disclosing the 7MB size cap, supported formats, that the file is stored byte-for-byte with no compression or resizing, and that a media ID is returned. These are non-obvious behavioral facts an agent needs before committing to this path.

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-loads the 'last resort' framing, follows with a compact ordered alternative list, then two short sentences of constraints and return value. Every sentence earns its place with no filler.

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 supplies the return value (media ID attachable to a post), the size limit, the accepted formats, and the storage semantics. Nothing an agent needs to call this correctly 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 description coverage is 100%, so the parameters are already fully documented, including the MIME enum. The description's format list (JPEG, PNG, GIF, WebP, MP4, MOV, PDF) essentially restates the enum rather than adding syntax or format guidance beyond it. Baseline 3 applies.

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 a file sent as a base64-encoded string') and immediately positions it against named siblings. A reader knows exactly what it does and why it exists as a distinct tool.

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 labels itself a 'last resort' and gives a prioritized ordering of five alternatives with the condition selecting each (attached file, shell commands via create_upload_url + finish_upload, user picking files, public URL). This is the strongest possible usage routing.

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