Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Validate a SQL query against the ontology

validate_sql
Read-onlyIdempotent

Validates a single read-only SELECT query before execution by checking permissions, table and column names, joins, scale mismatches, and fan-out, then running a database dry run.

Instructions

Validate a single SELECT query without returning rows: enforces the read-only guard, checks table/column names, verifies joins and default roles, flags near-miss literals, percent-vs-fraction scale mismatches, and one-to-many fan-out under aggregations, and runs a database dry run. Always call before run_sql and pass question when percentages appear; use run_sql only after fixing every reported error. Returns ok, errors, warnings, and the draft/certified status of relied-on Terms.

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": {
      "sql": "<sql>"
    },
    "name": "validate_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSingle read-only SELECT statement in the datasource's SQL dialect.
questionNoUser question; percentages mentioned in it are checked against the numeric scale of filtered columns.
datasourceNoDatasource name. Optional when only one datasource is registered.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.2
    • addedInput schema / properties / question
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "User question; percentages mentioned in it are checked against the numeric scale of filtered columns."
      +}
    • changedInput schema / properties / sql / description
      Previous value: -"One read-only SELECT in the datasource dialect."New value: +"Single read-only SELECT statement in the datasource's SQL dialect."
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint and destructiveHint=false, yet the description adds real substance: no rows are returned, a database dry run is executed, and specific classes of findings are produced (near-miss literals, percent-vs-fraction scale, fan-out under aggregations). It stops short of describing error-reporting behavior (fail-fast vs. all errors) or the cost of the dry run, keeping it just under a 5.

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

Conciseness4/5

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

Front-loaded with the core action and the call-ordering rule, and no sentence is filler. The first sentence is long and clause-heavy, packing seven check types into one breath, which slightly dilutes scannability.

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?

Covers purpose, mandatory call ordering, the checks performed, and the shape of the result (ok, errors, warnings, term status) even though an output schema exists. For a read-only validator with full schema coverage, nothing an agent needs to call it correctly is missing.

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 baseline is 3, but the description adds actionable meaning the schema does not: the 'question' parameter should be supplied specifically when percentages appear, tying an optional parameter to a concrete trigger condition.

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?

Opens with a specific verb and resource plus a scope qualifier: 'Validate a single SELECT query without returning rows.' It then enumerates the concrete checks performed, so an agent can distinguish it from run_sql without opening the schema.

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?

Explicit sequencing guidance: 'Always call before run_sql' and 'use run_sql only after fixing every reported error,' plus a conditional trigger ('pass question when percentages appear'). Both the when and the named alternative are stated outright.

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