Skip to main content
Glama
Auto Ontology MCP

Auto Ontology MCP

Look up stored values in a column

lookup_values
Read-onlyIdempotent

Query live distinct values in a table column to confirm exact literals for SQL WHERE filters. Returns matching values with row counts, spelling suggestions, or top values when no substring is given.

Instructions

Query live distinct values stored in one column ('table.column') to ground exact literal filters (places, products, statuses) before writing SQL. Use after get_query_context whenever a WHERE filter value is uncertain; use search_ontology to find which table or column holds a concept. Returns matching values with row counts, close spelling suggestions when contains matches nothing, or top values when contains is omitted.

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": {
      "column": "<column>"
    },
    "name": "lookup_values"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum distinct values to return (1-100).
columnYesTarget column formatted as 'table.column' (or 'schema.table.column').
containsNoCase-insensitive substring to filter values; omit to return the most frequent values.
datasourceNoDatasource name. Optional when only one datasource is registered.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.6.2
    • changedInput schema / properties / column / description
      Previous value: -"'table.column'."New value: +"Target column formatted as 'table.column' (or 'schema.table.column')."
    • changedInput schema / properties / contains / description
      Previous value: -"Case-insensitive text to look for. Omit to list the most common values."New value: +"Case-insensitive substring to filter values; omit to return the most frequent values."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum values."New value: +"Maximum distinct values to return (1-100)."
    • addedInput schema / properties / limit / maximum
      Added value: +100
    • addedInput schema / properties / limit / minimum
      Added value: +1
  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?

Annotations already cover the read-only, idempotent, non-destructive profile, so the description's job is to add context. It does: values are 'live' from the stored column, results carry row counts, and it discloses the fallback behaviors (spelling suggestions on a no-match, top values when contains is omitted). It leaves out any note on cost/latency of scanning a large column, which is the only real gap.

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 doing distinct work: what it does, when to use it versus siblings, what it returns. It is front-loaded with the purpose and contains no filler.

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

Completeness4/5

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

With an output schema present, the description needn't define return shapes, and it still summarizes the three result modes. Annotations and schema carry the safety and parameter burden, so the only missing piece is guidance on large-column cost or when a narrower column should be preferred.

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 all four parameters are already documented, including the 'omit contains for most frequent values' behavior. The description restates that semantics rather than adding new meaning such as expected 'table.column' formatting quirks or how limit interacts with suggestion fallback, so baseline 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 gives a specific verb and resource ('query live distinct values stored in one column') plus the reason it exists ('ground exact literal filters'). It explicitly distinguishes itself from get_query_context and search_ontology, so an agent can pick it 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?

It states the trigger ('after get_query_context whenever a WHERE filter value is uncertain') and names the alternative for a different need ('use search_ontology to find which table or column holds a concept'). When-to-use, prerequisites, and routing are all explicit.

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