Portal Query
portal_queryRead 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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Dataset 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. | |
| limit | No | Rows 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. | |
| where | No | Native filter. Socrata SoQL ("year > 2020"), Opendatasoft ODSQL, ArcGIS SQL, CKAN SQL WHERE clause, DKAN "col = value AND col2 > 5". | |
| domain | Yes | The portal hostname, e.g. data.texas.gov, data.medicaid.gov, data.ca.gov, public.opendatasoft.com, hub.arcgis.com. No path. | |
| offset | No | Rows to skip (default 0). | |
| columns | No | Columns to return (default all). | |
| filters | No | Equality filters on every platform, e.g. {"state":"TX"}. | |
| order_by | No | Sort, e.g. "year desc". | |
| platform | No | Optional. Skip detection when the platform is already known (from portal_detect). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| budget | No | ||
| domain | No | ||
| platform | No | ||
| returned | No | ||
| queryable | No | ||
| dataset_id | No | ||
| upstream_url | No |