Execute SELECT Query
execute_select_queryExecute read-only SQL queries against a Magento database with automatic row limiting and masking of sensitive data.
Instructions
Runs a read-only SELECT/SHOW/DESCRIBE/EXPLAIN against the Magento database. Auto-appends LIMIT 100 if missing. Parameter: sql (alias: query). Sensitive columns (password, token, cc_) are masked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | Read-only SQL starting with SELECT, SHOW, DESCRIBE, or EXPLAIN. Alias: query. | |
| limit | No | Max rows to return for SELECT queries. Defaults to 100. Hard cap: 1000. | |
| query | No | Alias for sql — same parameter, alternative name. | |
| profile | No | Override the MAGENTO_SQL_PROFILE env var for this call only. Use list_connection_profiles to see available names. | |
| magentoRoot | No | Absolute path to the Magento root (must contain app/etc/env.php). Defaults to MAGENTO_ROOT env var or auto-discovery. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| rows | Yes | ||
| sampled | No | ||
| rowCount | Yes | ||
| truncated | No |