Run SQL
run_sqlRun a SQL script on a real database engine and return every result set and error. The database is fresh and empty (unless sql_version is a preloaded sample) and is dropped after the run, so include the CREATE TABLE and INSERT statements the queries need. Separate statements with semicolons. Results over 200 rows are cut. The answer links to the script on sqlize.online.
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_version": "<sql_version>",
"code": "<code>"
},
"name": "run_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The SQL script: one or more statements | |
| sql_version | Yes | Engine and version, from list_databases (e.g. psql18, mysql84, mssql2022) | |
| calculate_cost | No | Also report the optimizer cost of each query, where the engine supports it |