Save query
save_querySave SQL to the query library, or overwrite one of your own saved queries by passing its id. Use it when the user wants to keep, reuse or schedule a query; pass the returned id to run_saved_query or create_schedule. Does not run the SQL, so test it with execute_query first. A new query is private to you until shared in the app; on an approved_queries connection it is a draft that cannot run until a person shares it, and the SQL of a shared query there cannot be changed. Passing an id replaces that query's name, SQL, connection and folder; you can only update queries you created. Needs the write scope, plus execute to change the SQL of a scheduled query.
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": {
"name": "<name>",
"sql": "<sql>"
},
"name": "save_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Id of the saved query to overwrite. Omit to create a new one. | |
| sql | Yes | The SQL to save. | |
| name | Yes | Display name in the query library. | |
| folderPath | No | Single folder label to file it under; null or omitted for the root. | |
| connectionId | No | Connection id from list_connections. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| sql | No | ||
| name | No | ||
| isShared | No | ||
| updatedAt | No | ||
| variables | No | Declared {{name}} variables, filled in by run_saved_query. | |
| folderPath | No | ||
| connectionId | No |