query_rewrite
Rewrites SQL queries for optimal performance while preserving correctness. Choose your database and optimization goal to get a rewritten query tailored to speed or memory.
Instructions
Pro: Rewrite SQL queries for optimal performance while preserving correctness
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": {
"query": "<query>"
},
"name": "query_rewrite"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SQL query to rewrite | |
| api_key | No | API key for authentication | |
| database | No | Database engine | postgresql |
| optimization_goal | No | Primary optimization goal | balanced |