Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Save a verified example SQL query

save_example_query
Idempotent

Store 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

NameRequiredDescriptionDefault
sqlYesValidated read-only SELECT query that correctly answered the question.
noteNoOptional rationale explaining business rules, filters, or exclusions in this SQL.
questionYesNatural-language question in the user's words.
datasourceNoDatasource name. Optional when only one datasource is registered.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.6.2
    • changedInput schema / properties / note / description
      Previous value: -"Why this SQL is right (definitions, exclusions)."New value: +"Optional rationale explaining business rules, filters, or exclusions in this SQL."
    • changedInput schema / properties / question / description
      Previous value: -"The question in the user's words."New value: +"Natural-language question in the user's words."
    • changedInput schema / properties / sql / description
      Previous value: -"The SQL that answered it correctly."New value: +"Validated read-only SELECT query that correctly answered the question."
  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?

Beyond the annotations, it discloses pre-write validation against the ontology and database, the atomic failure behavior (nothing is saved if validation fails), and upsert semantics keyed on the question. Those are side-effect and failure-mode details the annotations only hint at via idempotentHint.

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 tight sentences: purpose and consumers first, then the call condition and sibling exclusion, then behavioral guarantees. No filler or repeated phrasing.

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?

With annotations covering the safety profile, a full schema, and an output schema, the description needs only to add routing and behavioral context, which it does completely enough for an agent to call it correctly.

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 fields are already documented; the description still adds meaning by implying the question is the identity key (re-saving the same question updates its SQL) and that the SQL must pass validation, which the schema alone doesn't convey.

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 uses a specific verb-plus-resource ("Store a user-confirmed question and SQL pair") and names the concrete downstream effects on get_query_context and suggest_sql_attributes, which makes the tool's role unambiguous.

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 gives an explicit call condition ("Call only after the user confirms an answer is correct") and an explicit alternative with the condition that selects it ("use save_sql_attribute for standalone reusable expressions instead"). Both when-to-use and when-not-to-use are covered.

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