Save a verified example SQL query
save_example_queryStore a user-confirmed question and its validated SQL so similar future questions can reuse it, with updates applied when the same question is saved again.
Instructions
Store a user-confirmed question and SQL pair so get_query_context surfaces it for similar future questions and suggest_sql_attributes can mine reusable logic from it. Call only after the user confirms an answer is correct; use save_sql_attribute for standalone reusable expressions instead. Validates the SQL against the ontology and database first (saving nothing if validation fails); saving the same question again updates its SQL in place.
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": {
"question": "<question>",
"sql": "<sql>"
},
"name": "save_example_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Validated read-only SELECT query that correctly answered the question. | |
| note | No | Optional rationale explaining business rules, filters, or exclusions in this SQL. | |
| question | Yes | Natural-language question in the user's words. | |
| datasource | No | Datasource name. Optional when only one datasource is registered. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||