Skip to main content
Glama

Upload media

wp_upload_media

Uploads a file to the WordPress media library from a local path or public URL, returning the media ID for use as a featured image or in content.

Instructions

Upload a file to the media library from a local path or a public URL, and get back the media ID to use as a featured image or in content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoConfigured site name. Omit to use the default site.
titleNo
sourceYesAbsolute local file path, or an http(s) URL to fetch and re-upload.
captionNo
alt_textNoAlt text — set this for images.
filenameNoOverride the stored filename.
Behavior4/5

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

With no annotations provided, the description carries the burden of disclosure. It clearly states the action, input types, output (media ID), and intended usage. It lacks details about permissions or failure modes, but the core behavioral contract is transparent.

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?

A single focused sentence that front-loads the action and resource, with no filler or redundant repetition. Every phrase adds value.

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 straightforward upload tool, the description provides purpose, source options, and the media ID return value. With no output schema or annotations, it could mention error handling or response details, but the essential contract is clear and sufficient for selection.

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 67%, with source, site, alt_text, and filename already described. The description reinforces the source-type behavior and adds return-value context, but does not elaborate on title or caption semantics. This is adequate but not a significant addition beyond 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 uses a specific verb ('Upload') and resource ('media library'), states the source types (local path or public URL), and mentions the return value (media ID). It clearly distinguishes from sibling tools like wp_list_media, which lists media rather than uploading.

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 implies usage for adding media to the library and mentions a downstream use case ('featured image or in content'), but does not explicitly state when to use this tool versus alternatives or provide exclusions. This is adequate but not explicit.

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/amolb1986/wp-mcp'

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