Skip to main content
Glama

Change media details

wp_update_media
Destructive

Change the title, caption or alt text of a WordPress media file without replacing the file. Only the fields you pass are updated; use it to fix metadata, not to upload new files.

Instructions

Change the title, caption or alt text of one file in the media library (attachment); the file itself stays as it is. Only the fields passed change. Alt text is stored as plain text. Returns {updated: true, id}; an id that is not a media file returns a not-found error. Needs the right to edit that file. Title, caption and alt text can be public wherever the file is shown. A new file is added with wp_upload_media; a file's description and parent are changed with wp_update_post.

Input Schema

NameRequiredDescriptionDefault
idYesAttachment id, as wp_list_media returns it.
altNoNew alternative text for an image; an empty string clears it. When omitted, it stays as it is.
titleNoNew title. When omitted, it stays as it is.
captionNoNew caption; an empty string clears it. When omitted, it stays as it is.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only give generic hints (destructive, non-idempotent, open-world); the description adds concrete behavior: partial-update semantics, the exact return payload {updated: true, id}, a not-found error for ids that are not media, and the capability needed to edit the file. This is the kind of detail an agent cannot infer from structured fields.

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?

Four short sentences, front-loaded with scope and the non-mutation of file content, followed by update semantics, return shape, error case, permission, and sibling routing. No sentence is padding.

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?

With no output schema, the description still supplies the return shape and failure mode; with annotations covering safety, it supplies the permission requirement and partial-update rules. Nothing material for a correct call is missing.

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 the baseline is 3, but the description adds semantics beyond the schema: alt text is stored as plain text, and title/caption/alt text may be publicly visible wherever the file appears. That surfaces the real-world consequence of the values rather than restating the field docs.

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 (change) and bounded resource (title, caption, alt text of one attachment), and explicitly delimits what it does not touch: 'the file itself stays as it is'. It also names the adjacent tools (wp_upload_media, wp_update_post) so the agent can tell it apart from siblings at a glance.

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?

Provides explicit routing: adding a new file goes to wp_upload_media, and changing a file's description or parent goes to wp_update_post. Combined with 'Only the fields passed change', the agent knows both when to use this tool and where to send the neighboring cases.

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