Skip to main content
Glama

Upload media

create_media

Upload media to WordPress from a local file path, URL, or base64 data. Generates thumbnails and supports alt text, captions, and 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 http(s) URL to download and re-upload into the library. Private, loopback and local-network addresses are refused (except the WordPress site's own host).
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / post / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / post / minimum
      Added value: +-9007199254740991
    • addedInput schema / properties / set_as_featured_for / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / set_as_featured_for / minimum
      Added value: +-9007199254740991
    • changedInput schema / properties / url / description
      Previous value: -"Public URL to download and re-upload into the library."New value: +"Public http(s) URL to download and re-upload into the library. Private, loopback and local-network addresses are refused (except the WordPress site's own host)."
  2. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false, so the description rightly implies mutation. It goes beyond annotations by disclosing that WordPress runs its image pipeline and generates thumbnail sizes, and that the tool downloads URLs before uploading. The description also states the requirement for alt_text, which is a behavioral expectation beyond the schema. Given the annotations are minimal (just non-read-only), the description adds good behavioral context, though it could mention response or error behavior.

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?

The description is a compact two-sentence block that front-loads the core purpose and sources, then adds the alt_text guideline. The only minor inefficiency is a bit of parenthetical detail that could be trimmed, but overall it's appropriately sized for a complex multi-source tool.

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

Completeness5/5

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

Given the tool has 13 parameters all documented in the schema Michel, the description effectively focuses on the non-obvious aspects: source selection, local vs. remote paths, and the alt_text requirement. It compensates for the lack of an output schema by clarifying the upload process (download then upload, thumbnail generation). The description is complete for an agent to decide when and how to use it.

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?

Schema coverage is 100%, so per guidelines baseline is 3. The description adds value by explaining how file_path relates to the local machine, and that base64_data requires filename. It also explains the relationship between sources (mutually exclusive) and that alt_text is required for accessibility. This exceeds baseline by adding clarifications that are not in the schema, hence 4.

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 verb 'Upload' and the resource 'media library', and enumerates three distinct sources with precise names (file_path, url, base64_data). It distinguishes this from sibling tools like update_media/edit_media by focusing on creation, and even explains the meaning of file_path in the context of the local machine, which is a common source of confusion.

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?

The description explicitly explains the three input sources and when to use each: file_path for local screenshots, url for remote downloads, and base64_data for raw data. It also adds a critical guideline: 'Always set alt_text for images' with rationale, which is actionable usage guidance not present in the schema. The description implicitly covers exclusions like local-network URLs being refused, guiding the agent away from invalid input.

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

Deploy Server

Other Tools