Skip to main content
Glama

query_dataset

Query one topic's gold facts with dimension labels joined in (the district/school/county/demographic names come back on every row). filters is a dict of column → value or list-of-values: FK codes (district_code, school_code, county_fips, demographic) and any categorical column — see describe_dataset's filters for the exact keys and enum values. Use year (exact) OR year_min/year_max (range), never both. detail picks the grain (default is the finest available). Returns rows plus a columns descriptor array (type/role/unit/null-meaning, and is_key_metric flagging the headline column) so you interpret values and NULLs correctly — NULL usually means SUPPRESSED, not zero (see null_semantics). The top-level key_metric echoes which column is the answer. Use columns to project a subset, include_labels=false to skip the joined name columns (codes only), and order_by+order for server-side top-N instead of over-fetching. Pages are small (default 100, max 500); when truncated is true a bulk_export block points at the REST CSV/Parquet endpoint and the source path for the full pull — do not loop pagination to dump a table. A bad filter returns a self-describing error listing the valid keys/values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoExact year. Use this OR year_min/max.
limitNoPage size (default 100, max 500).
orderNoSort direction for order_by: 'asc' or 'desc'.asc
topicYesTopic name, e.g. 'act_scores'.
detailNoGrain (e.g. schools/districts/states); default finest.
offsetNoRow offset for paging (>= 0).
columnsNoProject only these output columns (fact columns + joined label columns). Smaller pages / fewer column reads. Omit for all columns.
filtersNoColumn → value (or list of values) filters. Keys are FK columns (district_code, school_code, county_fips, demographic) and categorical columns; read describe_dataset's `filters` for the exact keys and enum values FIRST. A value list is a union (OR); multiple keys AND together. A wrong key/value returns a self-describing error listing the valid ones.
order_byNoOrder by one fact column or joined label column (for server-side top-N). Default order is the row grain. NULL (suppressed) cells sort LAST in either direction, so a metric top-N is never polluted by suppressed rows.
year_maxNoInclusive upper year bound (range).
year_minNoInclusive lower year bound (range).
main_topicNoMain topic: 'education', 'census', or 'immigration'.education
include_labelsNoJoin district/school/county/demographic name columns (default true); false = codes only (faster, leaner).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / main_topic / description
      Previous value: -"Main topic: 'education' or 'census'."New value: +"Main topic: 'education', 'census', or 'immigration'."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden, and it delivers: NULL means SUPPRESSED not zero, page sizes (default 100, max 500), the `truncated` flag leading to a bulk_export block, NULL cells sorting last in either direction, and self-describing errors on bad filters. These are exactly the behavioral traits an agent needs and none are in structured fields.

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?

Every sentence carries information and the purpose leads, but the content is packed into one dense paragraph with no separation between invocation rules, return shape, and pagination policy. It is efficient rather than bloated, yet scanning for a single rule is harder than it needs to be.

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 13-parameter, high-complexity query tool with an output schema and no annotations, the description covers filter construction, grain, projection, ordering, NULL handling, pagination limits, and the truncation escape hatch. It even explains the `columns` descriptor and `key_metric` echo, which it did not need to given the output schema.

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, and the description adds genuine meaning on top: the filters dict is a union across a value list and ANDs across keys, and the exact filter keys/enums live in describe_dataset — critical since `filters` is a free-form object with additionalProperties=true. It largely restates the year exclusivity and include_labels tradeoff that the schema already documents.

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 ('Query one topic's gold facts with dimension labels joined in') and pins the return grain (labels on every row), which lets an agent distinguish it from siblings like aggregate and describe_dataset without opening a schema. The scope constraint (one topic) is front-loaded.

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 real routing guidance: 'see describe_dataset's filters for the exact keys and enum values' and 'do not loop pagination to dump a table' (route to bulk_export instead), plus the year vs year_min/max exclusivity rule. It never contrasts itself with the closest sibling, aggregate, so it stops short of explicit alternative selection.

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