Skip to main content
Glama

AI Engine for WordPress

Upload media

wp_upload_media

Add a file to the Media Library, either from a public URL that WordPress downloads or from base64 content with a filename. Optional title, description and alt text.

Input Schema

NameRequiredDescriptionDefault
altNo
urlNoURL to download the file from. Use this OR base64/filename.
titleNo
base64NoBase64-encoded file content. Must be used together with filename.
filenameNoFilename with extension (e.g. photo.jpg). Required when using base64.
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true. The description adds genuinely useful context by saying WordPress itself downloads the URL (a server-side fetch), but omits permission requirements, allowed file types, size limits, and whether an existing filename is overwritten.

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 short sentences, front-loaded with the action and the two modes. The trailing clause listing optional metadata is slightly redundant with the schema but does convey optionality at a glance.

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

Completeness3/5

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

For a six-parameter mutation tool with no output schema and no required parameters, the description leaves important gaps: what identifier is returned (an agent needs the media ID for follow-ups like wp_set_featured_image), and what happens when both or neither source is supplied.

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

Parameters4/5

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

With only 50% schema description coverage, the description compensates by stating that url and base64/filename are mutually exclusive alternatives and that title, description and alt are optional metadata. It still doesn't say whether one of the two sources is mandatory, which matters given zero required parameters.

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?

States a specific verb and resource ('Add a file to the Media Library') and enumerates the two supported ingestion modes. It implicitly distinguishes itself from wp_update_media and wp_get_media by framing the action as adding a new file, though no sibling is named.

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?

The description clarifies the choice between the URL mode and the base64+filename mode, which is real usage guidance. However, it never says when to use this tool versus wp_update_media, nor any preconditions such as required capabilities or that exactly one source must be supplied.

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