run_query
Execute SQL queries directly on a database connection. Returns columns, rows, execution time; errors include database messages.
Instructions
Run a SQL query directly against a database connection. Deterministic, no AI in the loop, no credits consumed. Returns columns, rows, rowCount, executionTime. On a SQL error the database's own message is returned — fix the SQL and retry. Rows cap at 500, so aggregate in SQL rather than pulling raw tables.
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": {
"connectionId": "<connectionId>",
"sql": "<sql>"
},
"name": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL statement to execute | |
| connectionId | Yes | Connection id from list_connections |