MySQL Read Query
mysql_read_queryExecute read-only SELECT queries safely with prepared statements, supporting pagination and streaming results.
Instructions
Execute a read-only SQL query (SELECT). Uses prepared statements for safety.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx | No | Alias for transactionId | |
| sql | No | Alias for query | |
| txId | No | Alias for transactionId | |
| query | No | SQL SELECT query to execute. Anti-Hallucination Hint: Must be a valid SQL query (e.g. 'SELECT * FROM users'), not just a table name. | |
| cursor | No | Opaque cursor for pagination (use nextCursor from previous response) | |
| params | No | Query parameters for prepared statement | |
| stream | No | Stream results via progress notifications instead of returning them all at once (requires client support) | |
| chunkSize | No | Number of rows per chunk when streaming (default: 10) | |
| transactionId | No | Optional transaction ID for executing within a transaction |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Error code (e.g. VALIDATION_ERROR, QUERY_ERROR) | |
| data | No | ||
| error | No | Error message if operation failed | |
| details | No | Additional error context | |
| metrics | No | Token estimation metrics | |
| success | Yes | Whether the operation succeeded | |
| category | No | Error category (validation, query, connection, internal) | |
| suggestion | No | Suggested fix for the error | |
| recoverable | No | Whether the error is recoverable |