Run a read-only SQL query
run_queryExecutes a single read-only SELECT or WITH statement against a connected database and returns the result rows as JSON, CSV, or Markdown.
Instructions
Runs a single read-only SELECT or WITH statement and returns the rows as JSON. Writes are rejected and results are capped.
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": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SELECT or WITH statement, written in the connected database's SQL dialect | |
| format | No | Output format for the rows: json (default), csv, or markdown |