execute_sql
Run SQL queries against the WordPress database via $wpdb to retrieve rows or insert, update, and delete records, using {prefix} for table names.
Instructions
Run a SQL query against the WordPress database via $wpdb. SELECT queries return rows; INSERT/UPDATE/DELETE return the affected row count. Table prefix is available as {prefix} in your query (e.g. SELECT * FROM {prefix}posts LIMIT 5).
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": {
"query": "<query>"
},
"name": "execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SQL query. Use {prefix} for the table prefix. |