wp_cli_run
Execute WP-CLI commands on WordPress sites via SSH. Destructive operations require a confirmation flow to prevent unintended changes.
Instructions
Execute an arbitrary wp-cli command on a site via SSH. The wp prefix and --path are added automatically — pass only the args (e.g. 'post list --post_type=page'). Destructive commands (delete, drop, search-replace without --dry-run, plugin deactivate/uninstall) require a two-call confirmation flow.
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": {
"args": "<args>"
},
"name": "wp_cli_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | No | ||
| args | Yes | WP-CLI args without leading 'wp', e.g. 'post list --post_type=page' | |
| timeout_ms | No | ||
| confirmation | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| command | Yes | ||
| stdout | No | ||
| stderr | No | ||
| exit_code | No | ||
| duration_ms | No | ||
| destructive_pattern_detected | No | ||
| confirmation_token | No | ||
| expires_in_seconds | No |