Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Execute a read-only SQL query

run_sql
Read-onlyIdempotent

Runs a validated, single read-only SELECT against a registered datasource and returns rows, columns, term status, and warnings; blocks writes, DDL, multiple statements, and uncataloged tables.

Instructions

Execute one read-only SELECT query against a registered datasource and return columns, rows, row_count, truncated flag, relied-on Terms (with draft/certified status), and warnings. Call after validate_sql passes; use lookup_values to inspect single-column values instead. Refuses writes, DDL, multiple statements, and uncataloged tables on a read-only connection, and logs the query with question for provenance.

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": "run_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSingle read-only SELECT statement in the datasource's SQL dialect.
max_rowsNoMaximum rows to return (>= 1; capped by the server's AUTO_ONTOLOGY_MAX_ROWS limit).
questionNoUser question logged with the query for provenance and used to check percent-vs-fraction thresholds.
datasourceNoDatasource name. Optional when only one datasource is registered.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.6.2
    • changedInput schema / properties / max_rows / description
      Previous value: -"Rows to return (capped by the server)."New value: +"Maximum rows to return (>= 1; capped by the server's AUTO_ONTOLOGY_MAX_ROWS limit)."
    • addedInput schema / properties / max_rows / minimum
      Added value: +1
    • changedInput schema / properties / question / description
      Previous value: -"The user's question, kept with the query for provenance."New value: +"User question logged with the query for provenance and used to check percent-vs-fraction thresholds."
    • 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.4/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint/idempotent), it discloses concrete enforcement: refuses writes, DDL, multiple statements, and uncataloged tables on a read-only connection, plus a side effect that the query is logged with the question for provenance. That is real behavioral context an agent cannot get from structured fields. It stops short of describing error shape or how 'truncated' is triggered, which the output schema partly covers.

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?

Three dense sentences, front-loaded with the core action, then the workflow prerequisite, then the refusal rules. Slight redundancy in enumerating the full return payload (columns, rows, row_count, truncated, Terms, warnings) when an output schema already exists.

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 4-param, single-required-param query tool, everything an agent needs is present: validation prerequisite, alternative for single-column lookups, what is rejected, and the logging side effect. The presence of an output schema means the return-value enumeration is a bonus rather than a necessity.

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

Parameters3/5

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

Schema coverage is 100%, so max_rows caps, datasource optionality, and the question's threshold-checking role are already documented in the schema. The description adds no additional parameter semantics such as SQL dialect quirks or how question influences results materially beyond the schema text, so the baseline of 3 applies.

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 opens with a specific verb+resource: 'Execute one read-only SELECT query against a registered datasource', and immediately states what comes back. It also distinguishes itself from the sibling lookup_values, so an agent can pick it out of a 30-tool catalog without opening 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?

Explicit sequencing ('Call after validate_sql passes') plus an explicit alternative for a different need ('use lookup_values to inspect single-column values instead'). Both the when and the when-not are stated, leaving nothing to inference.

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