Skip to main content
Glama

Update image alt text

wp_update_alt_text
Idempotent

Set or update an image's alt text in the WordPress Media Library, and when given a post ID with AI Site Auditor active, sync the same text to every matching in that post.

Instructions

Sets alt text for an image. With post_id and AI Site Auditor active, it updates both the Media Library and every of that image inside the post content; otherwise only the Media Library. Describe what the image shows and why it matters on the page, under 125 characters, without 'image of'. Set decorative for purely decorative images (empty alt).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "attachment_id": "<attachment_id>"
    },
    "name": "wp_update_alt_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
post_idNoPage or post where the image is used
alt_textNo
decorativeNo
attachment_idYesMedia Library image ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare mutation, idempotency, non-destructiveness, and closed-world scope. The description adds the important non-obvious behavior: with post_id and AI Site Auditor active, it updates both the Media Library and every matching <img> in the post content; otherwise it only updates the Media Library. It does not cover permissions or failure behavior, but it makes the conditional side effect clear.

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 front-loaded with the operation, then layers in conditional behavior and content guidance. Every sentence is relevant, and there is no filler or repetition.

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 four-parameter mutation tool with no output schema, it covers the main operational complexity: conditional dual update, alt-text composition guidance, and decorative handling. It omits return or error behavior, but that is not required when no output schema exists; overall it is sufficiently complete.

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 documents attachment_id and post_id, but leaves alt_text and decorative undocumented. The description compensates by specifying alt-text content guidance (under 125 characters, no 'image of') and that decorative images should get empty alt text. The interaction between alt_text and decorative could be clearer, but it adds substantial meaning beyond the schema.

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?

It states a specific verb and resource — sets alt text for an image — so an agent can identify the exact operation. It does not name or differentiate a sibling tool, which keeps it just below the top score.

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?

Usage is implied by the tool name and by the post_id branch: pass post_id to update in-post image instances when AI Site Auditor is active. There is no explicit when-not-to-use guidance and no alternative sibling named, so routing must be inferred.

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