Skip to main content
Glama
ondata

CKAN MCP Server

by ondata

Search CKAN DataStore

ckan_datastore_search
Read-onlyIdempotent

Query tabular data from a CKAN DataStore resource using SQL-like filters, full-text search, sorting, and pagination. Returns column names and records.

Instructions

Query data from a CKAN DataStore resource.

The DataStore allows SQL-like queries on tabular data. Not all resources have DataStore enabled.

The response always includes a Fields section listing all available column names and types. Use limit=0 to discover column names without fetching data — do this before using filters to avoid guessing column names and getting HTTP 400 errors.

Args:

  • server_url (string): Base URL of CKAN server

  • resource_id (string): ID of the DataStore resource

  • q (string): Full-text search query (optional)

  • filters (object): Key-value filters (e.g., { "anno": 2023 })

  • limit (number): Max rows to return (default: 100, max: 32000)

  • offset (number): Pagination offset (default: 0)

  • fields (array): Specific fields to return (optional)

  • sort (string): Sort field with direction (e.g., "anno desc")

  • distinct (boolean): Return distinct values (default: false)

  • response_format ('markdown' | 'json'): Output format

Returns: DataStore records matching query, always including available column names and types

Examples:

  • { server_url: "...", resource_id: "abc-123", limit: 0 } ← discover columns first

  • { server_url: "...", resource_id: "abc-123", limit: 50 }

  • { server_url: "...", resource_id: "...", filters: { "regione": "Sicilia" } }

  • { server_url: "...", resource_id: "...", sort: "anno desc", limit: 100 }

Typical workflow: ckan_package_search → ckan_package_show (find resource_id with datastore_active=true) → ckan_datastore_search (limit=0 to get columns) → ckan_datastore_search (with filters)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoFull-text search across all fields
sortNoSort expression (e.g., 'anno desc', 'nome asc')
limitNoMax rows to return (default 100, max 32000); use 0 to get only column names without data
fieldsNoSpecific field names to return; omit to return all fields
offsetNoPagination offset
filtersNoKey-value filters for exact matches (e.g., { "regione": "Sicilia", "anno": 2023 })
distinctNoReturn only distinct rows
server_urlYesBase URL of the CKAN server (e.g., https://dati.gov.it/opendata)
resource_idYesUUID of the DataStore resource (from ckan_package_show resource.id where datastore_active is true)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds value by stating the response always includes a Fields section, and that limit=0 returns only column names, avoiding HTTP 400 errors. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections and examples, but verbose. The docstring-style Args/Returns/Examples adds length; could be more concise. Still organized and front-loaded with the main purpose.

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?

Given 10 parameters, 2 required, no output schema, the description covers response structure, typical workflow, error avoidance, and example usage. It is comprehensive and leaves little ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds significant meaning: explains the role of limit=0 for column discovery, provides examples with real values, and clarifies the response_format. This goes beyond the schema's basic descriptions.

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?

The description clearly states 'Query data from a CKAN DataStore resource' and explains it allows SQL-like queries. It distinguishes itself from siblings like ckan_package_search or ckan_datastore_search_sql by focusing on DataStore queries with specific workflow steps.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidelines: use limit=0 to discover column names first, typical workflow chaining other tools, and examples. It also implies when not to use (if resource not datastore_active). Does not explicitly mention the sibling ckan_datastore_search_sql but covers usage well.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ondata/ckan-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server