Skip to main content
Glama

upload_media

Uploads an image, video, PDF, or other media file to WordPress from base64 data and returns the attachment ID for use as featured media.

Instructions

Upload a media file (image, video, PDF, etc.) to WordPress. Provide file data as base64-encoded string. Returns the attachment ID which can be used as featured_media on posts.

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": {
      "filename": "<filename>",
      "data": "<data>"
    },
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesBase64-encoded file content
titleNoMedia title
captionNoMedia caption
alt_textNoAlt text for images (accessibility)
filenameYesFilename with extension (e.g., 'photo.jpg', 'document.pdf')
descriptionNoMedia description

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses the input encoding contract and the return value (attachment ID usable as featured_media), but says nothing about required capabilities, file size/type restrictions, filename collisions, or failure behavior for a write operation.

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, with the verb and resource front-loaded and the encoding requirement immediately after. The return-value note is the only trailing information and it is genuinely actionable.

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 flat six-parameter mutation tool with no output schema, the definition covers what the tool does, how to encode input, and what comes back, which is enough to invoke it correctly. It stops short of the constraints (size limits, supported types, auth) that matter most for a file upload endpoint.

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 all six parameters including data, filename, alt_text, caption, title, and description are already documented. The description restates the base64 requirement for 'data' but adds no format, encoding, or constraint detail beyond the schema, so the baseline of 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 and resource ('Upload a media file ... to WordPress') plus accepted media kinds and the returned artifact. The verb cleanly separates it from all media siblings (get_media, list_media, delete_media) and from the post/page/comment tools.

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?

Usage is implied by the payload instruction ('Provide file data as base64-encoded string') and by the downstream hint that the returned ID can be used as featured_media on posts. There is no explicit when-to-use/when-not guidance and no mention of prerequisites such as upload permissions or size limits.

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