Search CKAN Datasets
ckan_search_datasetsSearch a CKAN catalog's public datasets by text, title words, tags, format, organization, or group, and return compact results with optional facet counts.
Instructions
Search one catalog's public datasets, with optional filters and counts per category (facets). Returns compact summaries; use ckan_get_dataset for full metadata and the file list.
Examples:
"ชุดข้อมูลเกี่ยวกับประชากร" -> query="ประชากร"
Words that must be in the title -> title="ประชากร อายุ"
"สถิติที่มีไฟล์ CSV" -> query="สถิติ", format="CSV", data_type="stat"
"มีหน่วยงานไหนบ้างและชุดข้อมูลละกี่ชุด" -> limit=0, facets=["organization"]
Use names returned by facets, ckan_list_organizations or ckan_list_groups for the organization and group filters.
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": {
"site": "<site>"
},
"name": "ckan_search_datasets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fq | No | Advanced: extra raw Solr filter, combined with AND | |
| tag | No | Exact tag, e.g. 'ประชากร' | |
| site | Yes | Site alias from ckan_list_sites, e.g. 'nso' | |
| sort | No | relevance, modified or created (newest first), or title | relevance |
| group | No | Group name (slug), not its display title | |
| limit | No | Datasets to return. 0 returns only counts and facets | |
| query | No | Free text, Thai or English. Do not write field:value here for Thai text; use title or the filters | |
| title | No | Space-separated words that must all appear in the title | |
| facets | No | Fields to count matches by | |
| format | No | Resource format, e.g. 'CSV' | |
| offset | No | Matches to skip, for pagination | |
| data_type | No | One of stat, record, gis, multi, other, or the Thai value such as 'ข้อมูลสถิติ' | |
| organization | No | Organization name (slug), not its display title | |
| response_format | No | 'markdown' for readable text, 'json' for structured data | markdown |