Skip to main content
Glama
aalises

Catalunya Open Data MCP

by aalises

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
NODE_ENVNoOne of development, test, or production.development
LOG_LEVELNoOne of trace, debug, info, warn, error, or silent.info
SOCRATA_APP_TOKENNoOptional Socrata app token for better rate-limit stability.
CATALUNYA_MCP_TRANSPORTNoOnly stdio is supported.stdio
CATALUNYA_MCP_MAX_RESULTSNoMaximum rows/results per tool call. Hard limit: 1000.100
CATALUNYA_MCP_BCN_GEO_SCAN_BYTESNoOptional maximum Open Data BCN CSV/JSON download body to read for one geospatial helper call. Unset or 0 means unlimited.
CATALUNYA_MCP_REQUEST_TIMEOUT_MSNoUpstream request timeout. Allowed range: 100 to 120000.30000
CATALUNYA_MCP_RESPONSE_MAX_BYTESNoMaximum upstream response body size. Allowed range: 65536 to 1048576.262144
CATALUNYA_MCP_BCN_GEO_SCAN_MAX_ROWSNoOptional maximum Open Data BCN rows to scan for geospatial helper calls. Unset or 0 means unlimited.
CATALUNYA_MCP_BCN_UPSTREAM_READ_BYTESNoMaximum Open Data BCN download preview body to read before parsing/capping. Allowed range: 65536 to 16777216.2097152
CATALUNYA_MCP_IDESCAT_UPSTREAM_READ_BYTESNoMaximum IDESCAT upstream success body to read before flattening/capping. Allowed range: 65536 to 33554432.8388608

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
pingA

Check that the Catalunya Open Data MCP server is running.

socrata_search_datasetsB

Discover dataset IDs and metadata from the Catalunya open data Socrata catalog.

socrata_describe_datasetA

Describe a Catalunya open data Socrata dataset, including queryable API field names.

socrata_query_datasetA

Query rows from a Catalunya open data Socrata dataset. Always call socrata_describe_dataset first and use returned field_name values, not display_name values. Pass clause values only, for example where: "municipi = 'Girona'"; never pass ?$where=... URL fragments. Supply order whenever using offset for stable pagination; without it, repeated calls may return duplicate or missing rows. Prefer narrowing filters or reducing $select over raising limit. Server caps row count and response bytes; truncation is signaled explicitly. Aggregate queries combine select with aggregate functions and group.

idescat_search_tablesA

Topic discovery for IDESCAT Tables v2. Search by subject and optional geography words or named places such as comarca, municipi, Maresme, Barcelonès, or Girona. Common semantic aliases such as taxa atur, paro, renda per capita, family income, and poblacio municipal can be used directly. Prefer results whose geo_candidates include the requested geo_id, then confirm with idescat_list_table_geos. Reuse the returned statistics_id, node_id, and table_id with idescat_list_table_geos. Search/list provenance is discovery-only; cite idescat_get_table_metadata or the metadata resource.

idescat_list_statisticsA

Browse fallback when idescat_search_tables is too broad or empty. Start here, then call idescat_list_nodes with a returned statistics_id.

idescat_list_nodesA

Browse nodes under an IDESCAT statistic. Use a statistics_id from idescat_list_statistics, then call idescat_list_tables with the returned node_id.

idescat_list_tablesB

Browse tables within an IDESCAT statistic node. Use returned statistics_id, node_id, and table_id with idescat_list_table_geos before metadata or data.

idescat_list_table_geosB

Required bridge from table discovery to metadata/data. Choose a returned geo_id, then call idescat_get_table_metadata before idescat_get_table_data.

idescat_get_table_metadataA

Inspect an IDESCAT table after selecting geo_id with idescat_list_table_geos. Optionally pass place_query with the original user place phrase, such as Maresme or renda Girona, to receive filter_guidance. Use returned dimension IDs, category IDs, and filter_guidance.recommended_data_call exactly in idescat_get_table_data filters; use this tool or its metadata resource for citations.

idescat_get_table_dataA

Fetch a bounded, flattened IDESCAT data extract only after idescat_list_table_geos and idescat_get_table_metadata. Every request requires statistics_id, node_id, table_id, and geo_id. Use metadata dimension/category IDs exactly in filters, and use last for recent periods. This is not an exhaustive export tool; if IDESCAT returns narrow_filters, call metadata and retry with filters or last.

bcn_search_packagesC

Discover Open Data BCN CKAN packages for Barcelona city datasets such as street trees, facilities, mobility, equipment, and services.

bcn_get_packageB

Fetch one Open Data BCN package, including resource IDs, formats, DataStore activity, package license, and provenance.

bcn_get_resource_infoA

Inspect one Open Data BCN resource. Active DataStore resources include queryable fields; inactive resources should use bcn_preview_resource.

bcn_query_resourceA

Query rows from an active Open Data BCN CKAN DataStore resource. Call bcn_get_resource_info first when possible and use returned field IDs. Pass filters as a JSON object, not raw SQL or URL query fragments. This always uses POST JSON to datastore_search and returns a bounded page with explicit truncation. If the resource is not DataStore-active, use bcn_preview_resource for a bounded CSV/JSON download preview.

bcn_resolve_placeA

Resolve a Barcelona place name to candidate WGS84 coordinates using only source-bounded Open Data BCN DataStore resources. Use this before bcn_query_resource_geo when the user gives a named place instead of lat/lon. Supports optional bbox and kind filters for facilities, landmarks, streets, neighborhoods, and districts.

bcn_recommend_resourcesA

Recommend high-value Open Data BCN resources for a natural-language city question. Use this before package search when the user asks broad questions such as trees on a street, facilities near a place, parks in an area, or district/neighborhood boundaries. The recommender is deterministic and source-bounded; follow up with bcn_get_resource_info, bcn_resolve_place, or bcn_query_resource_geo.

bcn_query_resource_geoA

Run a bounded geospatial query over an Open Data BCN resource with WGS84 latitude/longitude columns. Works for DataStore-active resources and safe BCN-hosted CSV/JSON downloads; active near/bbox calls use generated CKAN SQL internally. Use near for distance queries, bbox for rectangular areas, within_place for district/neighborhood polygons returned by bcn_resolve_place.area_ref, contains for street/name text filters, and group_by for counts such as species by street. Coordinate fields are inferred from common BCN names such as latitud/longitud, geo_epgs_4326_lat/geo_epgs_4326_lon, and geo_epgs_4326_y/geo_epgs_4326_x; pass lat_field/lon_field when ambiguous.

bcn_plan_queryA

Plan a natural-language Barcelona city question into an explainable Open Data BCN workflow. Returns recommended resources, optional source-bounded place resolution, final tool arguments, and citation guidance without running the final data query.

bcn_execute_city_queryC

Execute a safe bounded Open Data BCN city-question plan end-to-end. Blocks instead of guessing when the planner needs a resource or place selection.

bcn_answer_city_queryC

Execute a safe bounded Open Data BCN city-question plan and compose a deterministic caller-ready answer. Returns answer_text, answer_markdown, blocked selection_options, map-ready summary points, caveats, execution_notes, selected resource metadata, citation guidance, and the raw final_result.

bcn_preview_resourceA

Fetch a safe, bounded CSV or JSON preview for an Open Data BCN non-DataStore resource. Only HTTPS BCN-hosted download URLs and validated redirects are followed.

Prompts

Interactive templates invoked by user choice

NameDescription
socrata_query_workflowGuide a user through finding, describing, and querying a Catalunya Socrata dataset.
socrata_citationTemplate for citing a Catalunya Socrata dataset from described metadata.
idescat_query_workflowGuide a user through finding, inspecting, and querying an IDESCAT table.
idescat_citationTemplate for citing IDESCAT table metadata.
bcn_query_workflowGuide a user through finding and querying Open Data BCN resources.
bcn_citationTemplate for citing Open Data BCN packages and resources.

Resources

Contextual data attached and managed by the client

NameDescription
aboutBasic metadata for this MCP server.

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/aalises/catalunya-opendata-mcp'

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