Run SELECT
run_selectValidate and execute a read-only SQL query, rejecting writes and DDL before execution. Cap returned rows and optionally target a configured secondary read-only database.
Instructions
Validate and run a read-only SQL query. Writes, DDL, and other unsafe statements are rejected before execution.
Example: run_select(sql='SELECT id, email FROM users LIMIT 10', max_rows=1000)
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_select"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| columns | Yes | ||
| row_count | Yes | ||
| truncated | Yes |