run_query
Execute read-only SQL (SELECT, WITH, EXPLAIN) on a configured database to query data safely. Writes are blocked; policy-restricted tables are refused and redacted columns return [redacted].
Instructions
Execute a read-only SQL query (SELECT, WITH, EXPLAIN) on a configured database. Writes are blocked. If the database has a policy, queries reading tables outside it are refused with the reason, and redacted columns come back as "[redacted]" (listed in redacted).
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": {
"database_id": "<database_id>",
"sql": "<sql>"
},
"name": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Read-only SQL query | |
| limit | No | Max rows to return. Defaults to 100 with a ceiling of 1000 unless configured; each database's effective default and ceiling are in list_databases (rowLimits). Larger values are clamped to the ceiling. | |
| database_id | Yes | Database id from list_databases |