Skip to main content
Glama

wp_cli

Run WP-CLI commands against the active WordPress Playground instance to inspect or modify posts, options, plugins, themes, users, and database state; add unsupported commands as blueprint steps.

Instructions

Run a WP-CLI command against the active Playground instance. The command is executed via a PHP bridge that translates common WP-CLI commands into WordPress function calls. Supports: option, post, plugin, theme, user, site, db, eval, transient, menu, search-replace. For unsupported commands, include them as wp-cli steps in the blueprint.

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": {
      "command": "<command>"
    },
    "name": "wp_cli"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYesThe WP-CLI command to run (with or without the "wp" prefix). Examples: "post list --format=json", "option get blogname", "plugin list"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description does useful work by disclosing the execution mechanism (a PHP bridge translating WP-CLI into WordPress function calls) and the supported namespace list. However, it never warns that many supported namespaces (post, db, user, search-replace, plugin) can mutate or destroy data, nor does it describe error behavior or result format.

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?

Four short sentences, front-loaded with the core action and followed by mechanism, scope, and fallback in a logical order. The mechanism sentence could arguably be trimmed, but nothing is redundant.

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 single-parameter tool with no annotations and no output schema, the description covers mechanism, supported scope, and an unsupported-command fallback. It omits what the tool returns (raw WP-CLI stdout vs structured JSON, which depends heavily on --format) and any safety framing for destructive commands, which is a meaningful gap for this tool.

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% for the single 'command' parameter, and the schema already documents the optional 'wp' prefix and gives examples. The description's supported-namespace list adds some meaning about what values are valid, but it does not add syntax or flag guidance beyond the schema, so the baseline 3 applies.

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?

States a specific verb and resource ('Run a WP-CLI command against the active Playground instance') and enumerates the supported command namespaces, so the agent knows exactly what capability this exposes. It doesn't explicitly contrast itself with siblings like get_playground_info or get_playground_logs, but the purpose is unambiguous.

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?

Gives a clear operating context (must target the 'active' instance) and an explicit fallback: unsupported commands should be added as wp-cli steps in the blueprint. It stops short of stating prerequisites such as whether a playground must already be started, so it is strong but not fully explicit about when-not-to-use.

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