Skip to main content
Glama

Get data records

get_data
Read-onlyIdempotent

Fetch complete raw data records from a specific dataset path. Use filters and field selection to narrow results and avoid refusals on large queries.

Instructions

Fetch raw data records from one dataset path. For totals or averages across groups use get_summary instead — it aggregates server-side.

Results are COMPLETE or refused, never truncated, so counting and averaging over the rows returned is valid. A query matching over 10,000 rows is refused with its true size and how to narrow it. When one is too big, aggregate with get_summary, narrow to a state or district, or hand the user the bulk CSV link from the refusal or the R/Stata snippet from describe_dataset — for whole-country or long multi-year analysis those beat paging through calls.

COST: this hits a live API and a broad query can take 30s+. Filter before fetching rather than issuing many wide calls in parallel.

Args: path: A dataset path from search_datasets with every {placeholder} filled in — "schools/ccd/enrollment/2022/grade-99/race/". One year per call; a leading "/api/v1/" is optional. filters: "fips=11&charter=1". Only fields marked [FILTER] in describe_dataset work; others are rejected here rather than silently returning unfiltered data. Also takes "ordering=" to rank server-side: "ordering=-enrollment" largest first, "ordering=enrollment" smallest. Ranking sorts the whole result before paging, so a ranked query answers where an unranked one is refused as too large. fields: Comma-separated columns — "ncessch,school_name,enrollment". ALWAYS PASS THIS. These tables are 50-96 columns wide; requesting only what you need is typically an 8-17x reduction and is usually the difference between an answer and a refusal. add_labels: Decode coded values to labels (default True). Decoding is per variable, so meanings are FIELD-SPECIFIC — trust the decoded label over any assumption about what a raw code means. preview: Return a small labelled SAMPLE rather than a complete result. The rows are the API's first N by ID, NOT a random sample — never count, rank or average over them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
fieldsNo
filtersNo
previewNo
add_labelsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, destructiveHint. The description adds critical behavioral details: results are complete or refused, never truncated; queries over 10,000 rows are refused with true size and narrowing suggestions; a cost warning about 30s+ latency; preview rows are not random samples; decoding is field-specific. These go well beyond annotations.

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?

The description is long but every sentence carries essential information. It front-loads the core purpose and alternative guidance, then behavioral notes, then cost, then parameter details in a structured Args list. While dense, the structure makes it scannable; the length is justified by the tool's complexity.

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?

Given the tool's complexity (5 params, no schema descriptions, output schema present), the description covers all necessary context: when to use, cost, refusal behavior, sampling caveats, and parameter semantics. An agent has everything needed to call it correctly and avoid misuse.

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

Parameters5/5

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

Schema coverage is 0%, so the description is the sole source for parameter meaning. It explains path (with placeholder syntax and optional leading slash), filters (with example, only [FILTER] fields work, ordering semantics), fields (with example and strong advice to always pass), add_labels (default and caveat), and preview (non-random sample caveat). Each parameter is thoroughly documented.

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 states 'Fetch raw data records from one dataset path' — a specific verb, resource, and scope. It explicitly distinguishes from get_summary ('For totals or averages across groups use get_summary instead'), so an agent can tell it apart 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 explicitly directs when to use get_summary for aggregation, and suggests narrowing or using the bulk CSV link from refusal or the R/Stata snippet from describe_dataset for large analyses. It also advises filtering before fetching rather than issuing many wide calls in parallel, providing clear alternatives and context.

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