Skip to main content
Glama

Upload media

create_media

Upload images or files to WordPress media library from local paths, URLs, or base64 data, with automatic thumbnail generation, alt text support, and optional featured image assignment.

Instructions

Upload a file into the media library from any of three sources: file_path (a path on the machine running this MCP server — this is how you upload a local screenshot), url (downloaded here, then uploaded), or base64_data. WordPress runs its normal image pipeline, generating the registered thumbnail sizes. Always set alt_text for images — it is required for accessibility and read by search engines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic URL to download and re-upload into the library.
postNoAttach the upload to this content ID.
titleNoMedia title. Defaults to the filename.
captionNoCaption shown beneath the image.
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.
alt_textNoAlternative text. Set this for every image.
filenameNoFilename to store as. Defaults to the source filename; required for base64_data.
file_pathNoAbsolute or ~-relative path on the machine running this MCP server. For a Mac screenshot that is typically "~/Desktop/Screenshot 2026-08-23 at 2.29.04 PM.png". Not a path on the WordPress host.
attributionNoCredit line for a stock photo; appended to the description.
base64_dataNoRaw base64 file contents (a data: URI prefix is accepted and stripped). Requires `filename`.
descriptionNoLonger description, shown on the attachment page.
featured_for_typeNoContent type of set_as_featured_for.post
set_as_featured_forNoAfter uploading, set this attachment as the featured image of this content ID.
Behavior4/5

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

Annotations already indicate readOnlyHint=false and destructiveHint=false, so the write nature is clear. The description adds valuable behavioral context beyond the annotations: it mentions that WordPress runs its normal image pipeline and generates thumbnail sizes, and stresses the alt_text requirement. It also clarifies the file_path semantics, which prevents a common mistake. No contradictions with annotations.

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?

The description is three sentences long, front-loaded with the core action, and every sentence contributes value. It efficiently covers input sources, pipeline behavior, and a required field, with no redundancy or fluff.

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 tool with 13 parameters and no output schema, the description omits information about the return value (e.g., whether it returns the created media object or ID), which is important for chaining calls (e.g., set_as_featured_for). It also doesn't mention error cases or prerequisites beyond file availability. While the input side is well covered, the lack of return-value disclosure leaves a gap.

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 coverage is 100% with detailed descriptions for all 13 parameters, so the schema already carries the bulk of parameter meaning. The description adds a few extras (e.g., the local screenshot example for file_path, the accessibility importance of alt_text), but these are marginal. Baseline of 3 is appropriate since the description does not significantly improve parameter understanding over 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?

The description clearly states the action ('Upload a file into the media library') and specifies three distinct input sources (file_path, url, base64_data) with clarifying examples. It distinguishes itself from sibling tools like update_media, delete_media, and list_media by focusing on creation, and even provides a concrete use case for local screenshots.

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

Usage Guidelines4/5

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

The description provides practical usage guidance: it explains how to choose among the three input sources, clarifies that file_path is local to the server (not WordPress host), and mandates alt_text with a rationale. It does not explicitly mention alternative tools (e.g., search_stock_photos for finding stock photos), but the creation-focused context is obvious enough for an agent to know when to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alokemajumder/wpxmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server