Skip to main content
Glama

Governed semantic query

query_semantic
Read-onlyIdempotent
Run a governed query against the semantic layer: choose an entity, then
the metrics, dimensions and filters you want. Aliases are resolved to
physical columns by the registry, so this cannot reach anything the
semantic model does not expose. The result includes the generated SQL.

Bounded and self-describing.
UK only. Free. You are charged if the query reaches the
warehouse and then times out or errors there; a rejected query is free,
and so is one that matches no rows. Filter area facts on the
`analytics_area_id` from area_resolve; they are monthly, so a year
("2025") or quarter is widened to its months.

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": {
      "entity": "<entity>"
    },
    "name": "query_semantic"
  }
}

Input Schema

NameRequiredDescriptionDefault
joinsNo
limitNo
entityYes
periodNo
selectNo
filtersNo
metricsNo
order_byNo
dimensionsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: aliases are resolved by the registry so the query cannot reach outside the semantic model, the result includes the generated SQL, and the billing rule is explicit (charged only if the query reaches the warehouse and then times out or errors). What it does not cover is pagination/limit behavior or the default 500-row cap, which matters for result interpretation.

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, then governance, then cost, then the area-facts caveat—a sensible order. Some telegraphic fragments ('Bounded and self-describing.') add little, and the line-broken formatting reads as notes rather than prose.

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?

For a nine-parameter read-only query tool with an output schema, the description covers governance, cost, period granularity and the area-id join path. The remaining gaps (joins, limit, ordering behavior) are narrow relative to what is supplied elsewhere.

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 0% at the top level, so the description must carry the weight; it explains entity, metrics, dimensions, filters and alias-based filtering, and clarifies that period accepts a year or quarter that gets widened to months. It leaves joins and limit—two of nine parameters—entirely unexplained, so it only partially compensates.

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?

States a specific verb and resource ('run a governed query against the semantic layer') and immediately enumerates the shape of the input: entity, metrics, dimensions, filters. That distinguishes it from the concrete sibling tools like area_profile or area_series, which answer fixed questions rather than arbitrary governed queries.

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

Usage Guidelines4/5

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

Gives concrete routing guidance for one case: 'Filter area facts on the `analytics_area_id` from area_resolve', which names the sibling that produces the prerequisite value. It also frames cost conditions (rejected or zero-row queries are free). It stops short of saying when to prefer this over ask_question or a purpose-built sibling.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources