Get Dataset Schema
socrata_get_datasetFetch full metadata and column schema for a Socrata dataset by ID. Returns field names, data types, descriptions, row count, and licensing. Always call this before writing a socrata_query_dataset — the column types determine correct WHERE clause syntax: Number columns accept bare literals (year=2023) while Text columns require single-quoted strings (year='2023').
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset_id": "<dataset_id>"
},
"name": "socrata_get_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | Portal the dataset lives on, as a bare hostname (e.g. data.cityofnewyork.us); URL forms like https://data.cityofnewyork.us/ are accepted and reduced to the host. Pass the domain from the same socrata_find_datasets result as dataset_id. Defaults to SOCRATA_DEFAULT_DOMAIN or data.seattle.gov, which is wrong for another portal’s ID. | |
| dataset_id | Yes | Four-by-four dataset ID matching pattern like kzjm-xkqj. IDs are portal-scoped: take it from socrata_find_datasets together with that result’s domain. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Dataset display name. | |
| tags | No | Associated tags. | |
| error | No | Present when the call failed. Absent on success. | |
| domain | No | Portal domain hosting this dataset. | |
| columns | No | Column schema. Computed region columns (:@computed_region_*) are excluded to reduce noise. | |
| license | No | License name when available. | |
| category | No | Domain category when available. | |
| row_count | No | Approximate row count when available. See row_count_source for provenance. | |
| asset_type | No | Catalog asset type, such as dataset, filter (a filtered view), map, chart, calendar, visualization, measure, story, href (an external link), federated_href, file. Only dataset and filter answer socrata_query_dataset with rows. Absent when the catalog lists none. | |
| dataset_id | No | Four-by-four dataset ID, as requested. Query the dataset with this ID. | |
| description | No | Dataset description when available. | |
| data_updated_at | No | ISO 8601 timestamp of last data update when available. | |
| row_count_source | No | How row_count was obtained: 'top_level_cached_contents' — reported directly by the portal's views metadata; 'column_cached_contents' — derived as the maximum per-column cached count when the top-level value is absent. Absent when row_count is absent. | |
| canonical_dataset_id | No | The portal record's own ID, present only when the requested ID is an alias for it. The columns describe the requested ID's rows, which can differ from this ID's. |