Skip to main content
Glama

royal-mcp__wp_upload_media

Destructive

Upload a file to the media library. Accepts images and any document type the site allows in its media library (for example PDF). Send the file one of two ways: as file, a file the user attached or generated in the chat (clients that support file parameters, such as ChatGPT, fill this in), or as content_base64 with filename when you have the raw bytes. For files already hosted at a public link, prefer wp_upload_media_from_url. Only files that are part of the conversation (attached, or made by an image generator) come with a download link: a file created or edited in a code sandbox (a path like /mnt/data/...) has none, so ask the user to attach that file to the chat first, or upload the original instead. To convert, resize or compress an image on the way in (for example a JPEG under 400 KB), pass convert_to, max_width / max_height and max_kb here rather than editing the image in a code sandbox first: the site does the work, and the original generated or attached file keeps its download link. Pass if_exis… Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then.

Input Schema

NameRequiredDescriptionDefault
fileNoA file from the conversation. The client supplies a short-lived download link; the site fetches it once.
titleNo
max_kbNoImages only. Lower the quality step by step until the file is at most this many kilobytes. Works best with convert_to jpeg or webp.
captionNo
qualityNoImages only. Starting quality for JPEG or WebP (default 82).
site_idNoSite to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com)
alt_textNoAlt text (images only)
filenameNoFilename with extension (e.g. hero.jpg, report.pdf). Required with content_base64; optional with file.
if_existsNoreuse: when the same file (for a URL upload, the same URL) was already uploaded with the same image options, return that attachment instead of adding a duplicate. Default create.
max_widthNoImages only. Scale down to at most this many pixels wide, keeping proportions (never scales up).
convert_toNoImages only. Save the image in this format; a PNG from an image generator usually becomes a much smaller JPEG.
max_heightNoImages only. Scale down to at most this many pixels high, keeping proportions (never scales up).
content_base64NoBase64-encoded file bytes. Use this or file, not both. The bytes travel inside your own reply, so this suits small files only (roughly under 40 KB before encoding); for larger files use file or wp_upload_media_from_url.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only say readOnlyHint=false, destructiveHint=true, idempotentHint=false and openWorldHint=true; the description adds the non-obvious facts that the site fetches the download URL once, that bytes inside the reply are size-limited, and that the upload is gated on human approval in Royally so nothing changes until then. It stops short of describing what comes back (attachment ID / media item), which a destructive write tool should ideally state.

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?

Purpose and file-source selection are front-loaded in the first two sentences, with caveats following. It is dense but nearly every clause carries decision-relevant information, though the text is cut off mid-sentence at 'Pass if_exis…', leaving a visible fragment.

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 13-parameter, nested-object, approval-gated write tool with no output schema, the description covers input routing, limits, and the Royally gate well. The remaining gap is the response: with no output schema the agent must be told what a successful upload returns (attachment/media ID) to chain into wp_set_featured_image or update calls.

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 85%, so the baseline is 3. The description does add genuine guidance tying convert_to, max_width/max_height and max_kb to the goal of keeping the original file's download link, but most per-parameter meaning already lives in the schema.

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 and resource ('Upload a file to the media library') and immediately scopes accepted file types. It also names the sibling 'wp_upload_media_from_url' and distinguishes the two input paths, so an agent can separate it from other media tools without opening a 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 rules: use `file` for chat-attached/generated files, `content_base64` only for small raw bytes, and wp_upload_media_from_url for already-hosted files. It also names a concrete exclusion (sandbox paths like /mnt/data/... have no download link, so ask the user to attach) and recommends image conversion at upload time instead of pre-editing.

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