Skip to main content
Glama

upload_media

Destructive

Upload an image or file to the WordPress media library from a URL or base64 data, optionally attach it to a post, and return the attachment ID and URL.

Instructions

Upload an image/file to the media library from a URL or base64 data, and optionally attach it to a post. Returns the attachment ID and URL.

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
altNo
urlNoSource URL to download.
dataNoBase64 file data (alternative to url).
titleNo
filenameNo
attach_toNoPost ID to attach to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.2

TDQS

C2.9/5.0
Behavior3/5

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

The description adds real value by disclosing the return values (attachment ID and URL), which matters since there is no output schema, and by noting the optional attach side effect. However, annotations declare destructiveHint=true and the description never explains why — no mention of filename collisions, overwriting existing media, or required capabilities. The gap between the destructive flag and the benign framing is left unresolved.

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?

Two tight sentences, front-loaded with the core action and followed by the return contract. No filler, though the second sentence packs return values and optional attachment together rather than separating them.

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

Completeness2/5

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

For a mutable upload tool with a destructive annotation, six parameters with three undocumented, and no output schema, the description leaves too much open — no guidance on what happens with duplicate filenames, what alt/title do, or which of url/data is needed since nothing is marked required. It covers the happy path but not enough to call it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only 50% of the six parameters are documented in the schema (url, data, attach_to), leaving alt, title, and filename unexplained in both places. The description mentions the URL/base64 alternative but that merely restates schema text, and it says nothing about alt text, title, or filename behavior — so it fails to compensate for the coverage gap.

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 uses a specific verb and resource ("Upload an image/file to the media library") and states the two accepted sources plus the optional post attachment. It is clear enough to act on, but it does not differentiate from siblings like image_generate or image_search, so it stops short of a 5.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to choose this tool over alternatives such as image_generate (creating new images) or image_search (finding existing ones), and no stated prerequisites or exclusions. The only routing information is source-level (URL vs base64), which is already implied by the schema.

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