Skip to main content
Glama

upload_media

Uploads a media file to WordPress from base64 data or an allowed local path, matching filename extension to MIME type and respecting size limits.

Instructions

Upload media file to WordPress. Pass either file_data (base64) or file_path. The filename extension and file content must match mime_type. Size is capped at 10 MiB; with file_data, the transport's message size limit (including base64 overhead) usually applies first

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameNoOriginal filename; its extension must match mime_type (e.g., 'photo.jpg' for image/jpeg). Required with file_data
file_dataNoBase64 encoded file data. Requires filename and mime_type. Use file_path instead for files on this machine when it is enabled
file_pathNoAbsolute path of a file to upload, read by the mcp-rs server. Only files inside the folders listed in the server's upload_allowed_dirs setting can be read (disabled by default). filename and mime_type default to the file's name and extension
mime_typeNoMIME type of the file. Required with file_data. Allowed: image/jpeg, image/png, image/gif, image/webp, application/pdf, video/mp4, video/webm, video/ogg, audio/mpeg, audio/mp4, audio/wav, audio/ogg

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and idempotentHint=false, so the description isn't responsible for the safety profile. It adds genuinely useful non-obvious behavior: a 10 MiB hard cap and the caveat that with file_data the transport's message limit (with base64 overhead) usually binds first, and that extension/content must match mime_type. Missing are any auth/permission requirements or a note about what a successful upload yields.

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?

Three short sentences, zero filler, and the ordering is front-loaded: action first, input modes second, limits third. Every clause carries usable information for the caller.

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 4-param tool with an empty required list, the 'pass either file_data or file_path' sentence fills an important gap the schema leaves open. The main omission is what the tool returns (media ID, URL), which matters since no output schema exists; the 10 MiB and transport limits otherwise cover the risky parts.

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 baseline is 3 and the schema already explains filename, file_data, file_path, and the allowed mime list. The description adds the either/or relationship between file_data and file_path and the size interplay affecting file_data, but not enough over the schema to lift the score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete verb + resource ("Upload media file to WordPress") and immediately constrains the input modes, so the agent knows exactly what the call does. It stops short of naming a sibling (e.g., update_media vs. this) to delimit the boundary, but the name and first sentence are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It supplies the key selection rule between the two input modes ("Pass either file_data (base64) or file_path"), plus the size ceiling that governs when each is viable. It gives no guidance on when to use this tool versus delete_media/update_media, nor when not to use it, so usage is implied rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.