Skip to main content
Glama
briandconnelly

opendata-atlas

Atlas Query Dataset

atlas_query_dataset
Read-only

Run bounded, read-only SoQL queries or aggregates on one Socrata dataset to answer questions with live government open data. Use it for paging, counts, grouped breakdowns, or filters.

Instructions

Run a bounded read or aggregate on one dataset; paging stops at 10,000 rows.

For counts and breakdowns, use count() with group_by, not row paging. With cursor, send only portal, dataset_id, cursor, and optionally page_size or detail. For all rows, give the user download_url (detail="full") instead of paging. Illustrative example: {"portal": "example-city", "dataset_id": "abcd-1234", "select": ["type", "count() AS n"], "group_by": ["type"], "order_by": ["n DESC"]}. Typically 1-5 s; fails with query_timeout after 30 s.

Input Schema

NameRequiredDescriptionDefault
modeNoclauses (default): built from the clause arguments, paged by cursor. soql: run `soql` verbatim, one page.
nearNoRows within radius_m meters of a point; omit for no distance filter.
soqlNoFull SoQL statement; set mode='soql' and no clause arguments. Not paged: use LIMIT <= page_size and advance OFFSET.
whereNoSoQL predicate, e.g. "datetime >= '2026-09-01T00:00:00'". Never append Z or call now(); both fail. Omit for all rows.
cursorNonext_cursor from the previous page; omit for page one.
detailNosummary (default) or full: adds query_url and download_url (CSV of all matching rows).
havingNoPredicate on aggregated rows, e.g. "n > 10"; omit for none.
portalYesPortal id (its hostname) or alias, from atlas_find_portals. Repeat it on every page of a paged call.
selectNoColumns or expressions, e.g. ["type", "count(*) AS n"]. Omit for all data columns.
group_byNoe.g. ["type"]; omit for no grouping.
order_byNoe.g. ["n DESC"]; omit for arbitrary order. DESC lists nulls first: for most recent, add `col IS NOT NULL` to where.
page_sizeNoMost rows to return (default 100; wide rows may return fewer). Omit on a continuation to keep the first page's size.
dataset_idYesSocrata dataset id, e.g. abcd-1234 (from atlas_search_datasets).
search_textNoFull-text search across text columns; omit for none.

Output Schema

NameRequiredDescriptionDefault
rowsYes
hintsNo
sourceYes
columnsYes
has_moreYes
query_urlNo
truncatedYes
dataset_idYes
consistencyYes
next_cursorNo
download_urlNo
returned_rowsYes
effective_queryNo
truncation_hintNo
knowledge_noticeNoWhat this result relies on that no reviewed claim covers; level is the dataset's.
coverage_warningsNo
query_url_omittedNo
truncation_reasonNo
download_url_omittedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint, openWorldHint), and the description adds substantial behavior beyond them: the 10,000-row paging cap, typical 1-5 s latency, failure mode query_timeout after 30 s, and the cursor protocol requirement to repeat portal (confirmed also in the schema). This is exactly the kind of operational context an agent needs before committing to a call.

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?

Front-loads the core operation and its bound, then layers routing rules, the cursor-only parameter subset, the download escape hatch, and a compact illustrative call. Every sentence carries distinct information and the worked example is the densest way to convey the group_by/order_by idiom.

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 14-parameter tool with an output schema and full schema coverage, the description supplies what the schema cannot: the paging ceiling, aggregate-vs-page routing, continuation-parameter discipline, download fallback, and timeout behavior. Return-value explanation is rightly delegated to 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 description coverage is 100% across 14 params, so baseline is 3. The description goes further by stating cross-parameter rules the schema only implies per-parameter: which fields to send on a cursor continuation, and that aggregates should use count(*) with group_by rather than paging. It doesn't cover the soql/near/search_text modes at all, so not a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run a bounded read or aggregate on one dataset') and adds the hard scope limit (paging stops at 10,000 rows). It does not name or contrast against any sibling (atlas_describe_dataset, atlas_search_datasets), so the agent must infer that this is the query/aggregate tool rather than the discovery or metadata tool.

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?

Gives explicit routing rules: aggregates via count(*)+group_by instead of row paging, send only portal/dataset_id/cursor plus optional page_size or detail on continuations, and give the user download_url with detail='full' rather than paging all rows. These are concrete when-to-use and when-not-to-paging instructions, not vague hints.

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