Save or delete a SQL attribute
save_sql_attributeCreates, updates, certifies, or deletes named SQL expressions attached to a Term, validating each expression read-only before saving and rejecting broken SQL.
Instructions
Create, update, certify, or permanently delete a named SQL expression attached to a Term. Use to persist candidates from suggest_sql_attributes or reusable business metrics; use save_example_query for full question-and-SQL pairs and update_term for Term definitions. Probes the expression read-only against the database before saving and rejects broken SQL without saving. Editing a certified attribute's expression resets it to draft; delete=true removes it permanently.
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": {
"term": "<term>",
"name": "<name>"
},
"name": "save_sql_attribute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Expression category: 'measure', 'filter', or 'dimension' for single-table fragments; 'join' or 'query' for full SELECT statements. | measure |
| name | Yes | Title Case attribute name, e.g. 'Net Revenue'. | |
| term | Yes | Owning Term name, synonym, or id. | |
| delete | No | Set true to permanently delete this SQL attribute. | |
| status | No | Set 'certified' only after explicit user approval. | |
| datasource | No | Datasource name. Optional when only one datasource is registered. | |
| expression | No | SQL in the datasource dialect. measure/dimension/filter: a fragment over the Term's own table qualified by the bare table name (SUM(order_lines.line_total)). join/query: a full SELECT. | |
| description | No | Business meaning of the expression and when to use it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||