Run read-only SQL
queryRun a single read-only SQL statement against PostgreSQL; results are capped at 200 rows and PII columns/text patterns are masked with stable tokens, enabling safe aggregate analysis.
Instructions
Run a single read-only SQL statement (SELECT / WITH / SHOW / DESCRIBE / EXPLAIN) against postgres. Results are capped at 200 rows. PII is masked before results are returned: columns recognised as PII (email, phone, name, address, Aadhaar, PAN, card numbers, passwords...) are replaced with stable tokens like <EMAIL_3f9a1c2b7d> (same input → same token, so you can still GROUP BY / COUNT DISTINCT / compare), and PII patterns found inside other text columns are masked too. Prefer aggregates (COUNT, GROUP BY) over pulling raw rows. Use ? (MySQL) or $1 (Postgres) placeholders with params.
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": {
"sql": "<sql>"
},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SQL statement. | |
| params | No | Bind parameters for placeholders. |