Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Save or delete a SQL attribute

save_sql_attribute
DestructiveIdempotent

Creates, 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

NameRequiredDescriptionDefault
kindNoExpression category: 'measure', 'filter', or 'dimension' for single-table fragments; 'join' or 'query' for full SELECT statements.measure
nameYesTitle Case attribute name, e.g. 'Net Revenue'.
termYesOwning Term name, synonym, or id.
deleteNoSet true to permanently delete this SQL attribute.
statusNoSet 'certified' only after explicit user approval.
datasourceNoDatasource name. Optional when only one datasource is registered.
expressionNoSQL 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.
descriptionNoBusiness meaning of the expression and when to use it.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.6.2
    • changedInput schema / properties / delete / description
      Previous value: -"Delete this SQL attribute."New value: +"Set true to permanently delete this SQL attribute."
    • changedInput schema / properties / description / description
      Previous value: -"What it captures and when to use it."New value: +"Business meaning of the expression and when to use it."
    • changedInput schema / properties / kind / description
      Previous value: -"Type of expression."New value: +"Expression category: 'measure', 'filter', or 'dimension' for single-table fragments; 'join' or 'query' for full SELECT statements."
    • changedInput schema / properties / name / description
      Previous value: -"Title Case name, e.g. 'Net Revenue'."New value: +"Title Case attribute name, e.g. 'Net Revenue'."
    • changedInput schema / properties / status / description
      Previous value: -"Set certified only when a person approved it."New value: +"Set 'certified' only after explicit user approval."
    • changedInput schema / properties / term / description
      Previous value: -"Owning Term name."New value: +"Owning Term name, synonym, or id."
  2. First observedv0.3.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, but the description adds substantial non-annotated behavior: a read-only probe of the expression against the database that rejects broken SQL before saving, the certified-to-draft reset on edit, and the permanence of deletion. It also implicitly covers the multi-mode nature of the tool (create/update/certify/delete) rather than contradicting annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each carrying distinct load: the operations, the sibling routing, and the validation/mutation side effects. The primary action is front-loaded and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive multi-mode mutation tool, the description covers prerequisites, side effects, irreversible deletion, and alternatives. An output schema exists, so return-value detail is correctly omitted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all eight parameters, establishing a baseline of 3. The description goes beyond it by explaining cross-parameter behavior not captured in the schema: editing a certified attribute's expression resets status to draft, and delete=true removes the attribute permanently. It stops short of elaborating on kind/expression dialect nuances, which the schema handles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names specific verbs (create, update, certify, permanently delete) applied to a specific resource (a named SQL expression attached to a Term). It also explicitly distinguishes itself from sibling tools (save_example_query for question-and-SQL pairs, update_term for Term definitions), so an agent can differentiate without inspecting schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states exactly when to use this tool (persisting candidates from suggest_sql_attributes or reusable business metrics) and names two alternatives with the conditions that select them. There is no inference required to route between this tool and its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.