execute_query
Run read-only SQL queries against PostgreSQL and return JSON results. Mutating statements are blocked, enabling safe schema inspection and data exploration.
Instructions
Execute a read-only SQL query and return results as JSON.
The query must be a SELECT (or WITH … SELECT / EXPLAIN / SHOW / TABLE / VALUES). Mutating statements are rejected before they reach the database.
Args: sql: The SQL query to execute. limit: Maximum number of rows to return (default: 500, max: 5000).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |