Skip to main content
Glama

Socrata Dataset Query

socrata.datasets.query
Read-onlyIdempotent

Run a SoQL query against a specific dataset's actual data rows on a Socrata portal — supports $select, $where, $order, $group, $limit, and $offset clauses (see socrata.dataset_metadata for column names). Returns the matching rows as JSON. Use socrata.dataset_search first to find a domain + dataset_id. Data: per-portal Socrata resource API (e.g. data.cityofnewyork.us), no auth required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupNoSoQL $group clause, e.g. "complaint_type"
limitNoMax rows to return, 1-1000 (default 50)
orderNoSoQL $order clause, e.g. "created_date DESC"
whereNoSoQL $where clause, e.g. "borough='BROOKLYN'" or "created_date>'2026-01-01'"
domainYesSocrata portal hostname, e.g. "data.cityofnewyork.us" (from socrata.dataset_search results)
offsetNoPagination offset (default 0)
selectNoSoQL $select clause, e.g. "complaint_type,count(*)" (see socrata.dataset_metadata for column names)
dataset_idYesSocrata dataset 4x4 identifier, e.g. "erm2-nwe9" (from socrata.dataset_search results)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior; the description adds 'no auth required' and the per-portal resource API nature, plus the JSON return format. No contradiction with annotations.

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 dense sentences front-load the operation and clauses before the prerequisite and endpoint details. No wasted words; all information earns its place.

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 output schema present and annotations covering safety, the description provides the missing workflow (search first, get columns from metadata), example domain, and auth status. It is complete enough for an agent to invoke correctly; minor absence of explicit pagination guidance is covered by schema on limit/offset.

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 covers all 8 params with descriptions and examples. The description adds the SoQL clause mapping and the requirement to consult socrata.dataset_metadata for column names, but this is supplementary; baseline 3 due to full schema coverage.

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 names an explicit verb-resource pair ('Run a SoQL query against a specific dataset's actual data rows') and differentiates from sibling search/detail tools by emphasizing actual data rows. It lists the supported SoQL clauses, leaving no ambiguity about scope.

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?

It tells the agent to call socrata.dataset_search first to obtain domain and dataset_id, and points to socrata.dataset_metadata for column names. It doesn't spell out when not to use this tool vs socrata.datasets.detail, but the prerequisite and clause context effectively route invocation.

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.