socrata.datasets.query
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 + datase...
This record as markdown: /tools/io-github-whiteknightonhorse-apibase/socrata.datasets.query.md
What socrata.datasets.query does on Apibase
AI agents invoke socrata.datasets.query to trigger actions in Apibase. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
group | string | — | SoQL $group clause, e.g. "complaint_type" |
limit | integer | — | Max rows to return, 1-1000 (default 50) |
order | string | — | SoQL $order clause, e.g. "created_date DESC" |
where | string | — | SoQL $where clause, e.g. "borough='BROOKLYN'" or "created_date>'2026-01-01'" |
domain | string | Yes | Socrata portal hostname, e.g. "data.cityofnewyork.us" (from socrata.dataset_search results) |
offset | integer | — | Pagination offset (default 0) |
select | string | — | SoQL $select clause, e.g. "complaint_type,count(*)" (see socrata.dataset_metadata for column names) |
dataset_id | string | Yes | Socrata dataset 4x4 identifier, e.g. "erm2-nwe9" (from socrata.dataset_search results) |
Parameters from the server's own tool schema.
Why socrata.datasets.query is rated High
Executes arbitrary SoQL queries against external Socrata portals; results depend on arguments.
From the tool's definition Run a SoQL query against a specific dataset's actual data rows
Attacks that exploit this kind of access
The rule that runs socrata.datasets.query safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Apibase, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For socrata.datasets.query, this is the rule to start with:
socrata.datasets.query stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Apibase, apply this rule, and every socrata.datasets.query call is checked against it from then on.
Questions about socrata.datasets.query
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. It is categorised as a Execute tool in the Apibase MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
socrata.datasets.query accepts 8 parameters: group, limit, order, where, domain, offset, select, dataset_id. Required: domain, dataset_id. The full parameter table on this page comes from the server's own tool schema.
Register the Apibase MCP server in PolicyLayer and add a rule for socrata.datasets.query: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Apibase. Nothing to install.
socrata.datasets.query is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the socrata.datasets.query rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for socrata.datasets.query. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
socrata.datasets.query is provided by the Apibase MCP server (apibase-mcp-client). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Apibase, and thousands of servers like it.
Across the catalogue