Skip to main content
Glama

Open Data Portals

Portal Query

portal_query
Read-onlyIdempotent

Read real rows from a dataset on a CKAN, Socrata, DKAN, Opendatasoft or ArcGIS Hub portal using the platform's own query API (CKAN datastore_search / datastore_search_sql, SoQL, DKAN datastore query, Opendatasoft records, ArcGIS FeatureServer query). where is the platform's native filter syntax; filters is plain equality that works on every platform. If the resource has no query API, returns queryable:false with its download URL (web-fetch query_table can read a CSV download). Zero rows is an error, not a success. Names the platform and the exact upstream URL called.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "9cir-efmm",
      "limit": 3,
      "domain": "data.texas.gov",
      "columns": [
        "taxpayer_name",
        "taxpayer_city"
      ],
      "filters": {
        "taxpayer_city": "AUSTIN"
      }
    },
    "name": "portal_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesDataset or resource id: CKAN resource id (or dataset name), Socrata 4x4, DKAN uuid (append /N for the Nth distribution), Opendatasoft dataset_id, ArcGIS Hub item_layer id.
limitNoRows per call, default 25, maximum 500 (a larger limit is clamped and the response says so; Opendatasoft caps a page at 100). Page with offset and next_offset. A result is capped at about 1.5 million characters and says so when trimmed.
whereNoNative filter. Socrata SoQL ("year > 2020"), Opendatasoft ODSQL, ArcGIS SQL, CKAN SQL WHERE clause, DKAN "col = value AND col2 > 5".
domainYesThe portal hostname, e.g. data.texas.gov, data.medicaid.gov, data.ca.gov, public.opendatasoft.com, hub.arcgis.com. No path.
offsetNoRows to skip (default 0).
columnsNoColumns to return (default all).
filtersNoEquality filters on every platform, e.g. {"state":"TX"}.
order_byNoSort, e.g. "year desc".
platformNoOptional. Skip detection when the platform is already known (from portal_detect).

Output Schema

NameRequiredDescriptionDefault
rowsNo
budgetNo
domainNo
platformNo
returnedNo
queryableNo
dataset_idNo
upstream_urlNo

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 declare readOnly/idempotent/openWorld/non-destructive, so the bar is lower, and the description still adds genuine behavioral context: zero rows is an error rather than a success, and a non-queryable resource returns queryable:false with a download URL. It also promises the platform and upstream URL are reported, which aids verification; limit clamping and character caps live in the schema rather than here.

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?

Front-loaded with the core action, then the filter distinction, then the failure mode. Dense but every sentence carries information; the long parenthetical API list is the only mildly costly element.

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?

An output schema exists, so return values need not be explained, and the description covers the remaining essentials for a nine-parameter, five-platform tool: filter strategy, fallback path, and error semantics. Nothing an agent needs in order to call it correctly is missing.

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 description coverage is 100%, so the schema already documents all nine parameters including the where/filters distinction and per-platform id formats. The description reinforces the semantics of `where` vs `filters` but adds no syntax or constraint detail beyond what the schema already carries.

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 ('Read real rows from a dataset') and immediately enumerates the five platforms and the exact upstream APIs used. It is clearly distinguishable from portal_search_datasets, portal_dataset, and query_table, which it names directly.

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?

Explicitly routes the agent between `where` (native syntax) and `filters` (portable equality), and gives a concrete fallback when no query API exists: 'web-fetch query_table can read a CSV download'. It does not state when to prefer portal_dataset over this tool, so it stops just short of full when/when-not coverage.

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.