Skip to main content
Glama

wp_cli_execute

Execute allowlisted WP-CLI commands to manage WordPress plugins, cache, posts, and themes while unsafe commands are blocked. Provide the command without the "wp" prefix.

Instructions

Execute a WP-CLI command. Deny by default: only allowlisted commands run (cache, comment, core, cron, language, media, menu, option, plugin, post, rewrite, role, sidebar, site, term, theme, transient, user, widget). db, eval, eval-file, shell, server, config and package are refused, as are the --require, --exec, --ssh, --http and --path flags. Quote any value containing shell metacharacters. The feature is off unless the site owner set WPAIA_ENABLE_WPCLI in wp-config.php — call wp_cli_status first. Do NOT include the "wp" prefix (e.g., "plugin list", "cache flush").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe WP-CLI command to execute without the "wp" prefix (e.g., "plugin list", "cache flush", "rewrite flush")
Behavior5/5

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

With zero annotations, the description carries the full disclosure burden and delivers thoroughly: the deny-by-default model, explicit denylists for commands and flags, the WPAIA_ENABLE_WPCLI feature-flag gate, and the shell-quoting requirement. This is exactly the behavioral context an agent needs before invoking an arbitrary command executor, including the prerequisite status check that prevents wasted calls.

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 purpose is front-loaded in the first sentence and nearly every clause is informative — the denylist, flag restrictions, quoting rule, and prerequisite all earn their place. The 19-item allowlist and several rules run together in one dense paragraph, so bulleted structure would improve scannability without adding length.

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 high-risk generic executor with no annotations and no output schema, it admirably covers the safety model, permitted and refused inputs, the prerequisite status check, and the invocation format. It stops short of describing return or error behavior for denied commands, and it does not route to any of the many sibling tools that cover specific task families.

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% (baseline 3), but the description adds meaning beyond the schema's brief example: it communicates the quoting requirement, reinforces the no-prefix convention, and explains the allow/deny constraints that determine legal values for the command parameter.

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?

Opens with a specific verb and resource — 'Execute a WP-CLI command' — and then defines scope precisely via the allowlisted command namespaces (cache, plugin, post, etc.), which clearly distinguishes this raw executor from purpose-built siblings like wp_install_plugin or wp_get_option. The description leaves no doubt about what the tool is for.

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?

Provides explicit operational rules: 'call wp_cli_status first', 'Do NOT include the "wp" prefix', and 'Quote any value containing shell metacharacters.' It also names refused commands and flags. However, it never tells the agent to prefer a specific sibling wrapper (e.g., wp_install_plugin) when an allowlisted command family has a dedicated tool, so the when-vs-alternative routing is incomplete.

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/THE-KIPDEV/wpagent-mcp'

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