submit_query_feedback
Rate the accuracy of generated SQL and supply corrected SQL when incorrect. This feedback trains the smart_query model to reduce future errors.
Instructions
Record whether the SQL produced for a question was correct, so smart_query improves over time. Behavior: stores an up/down rating; when you rate 'down' and supply the correct SQL, the error is classified and, if the same kind of mistake recurs, automatically promoted into a few-shot example. Returns the feedback id and any error type or promotion. Usage: call after reviewing smart_query/run_query output; feedback is stored locally per data_source_id and feeds the learning loop.
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": {
"data_source_id": "<data_source_id>",
"question": "<question>",
"generated_sql": "<generated_sql>",
"rating": "<rating>"
},
"name": "submit_query_feedback"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rating | Yes | Rating: up (correct) or down (incorrect) | |
| question | Yes | Original natural-language question | |
| correct_sql | No | Correct SQL (provide when rating=down for automatic learning) | |
| generated_sql | Yes | Generated SQL | |
| data_source_id | Yes | Data source ID |