swiss-statistics-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Host to bind the HTTP server to. Default is 127.0.0.1. Set to 0.0.0.0 for cloud deployment. | |
| MCP_LOG_LEVEL | No | Log level (e.g., DEBUG, INFO, WARNING). Default is INFO. | |
| MCP_RETRY_WAIT_MAX | No | Maximum wait time in seconds for exponential backoff. Default is 4. | |
| MCP_RETRY_MAX_ATTEMPTS | No | Maximum number of retry attempts for transient BFS API errors. Default is 3. | |
| MCP_RETRY_WAIT_INITIAL | No | Initial wait time in seconds for exponential backoff. Default is 0.5. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| bfs_browse_catalogA | Browse the BFS catalogue: the theme list, or the datasets within a theme. Two modes in one tool (
Args: params (BrowseCatalogInput): - theme_code (str | None): 2-digit theme code, e.g. '15' for Bildung; omit for the theme list - lang (str): Language code ('de', 'fr', 'it', 'en') - limit (int): Max tables to return (theme mode; default 20) Returns:
BrowseCatalogResult. |
| bfs_search_tablesA | Search for BFS statistical tables by keyword in their titles. Performs a full-text search across all 682+ BFS table titles. Results include table IDs needed for bfs_get_table_metadata and bfs_get_data. Note: First call builds a catalog (~682 API requests). Subsequent calls within 1 hour use the cached catalog and are instant. Args: params (SearchTablesInput): - query (str): Search keywords, e.g. 'Lehrkräfte', 'Schüler Kanton' - theme_code (Optional[str]): Filter by theme, e.g. '15' - lang (str): Language for table titles - limit (int): Max results (default 10) Returns:
SearchTablesResult with matching tables. On error, |
| bfs_get_table_metadataA | Get metadata for a BFS table: title, variables, and available filter values. Essential step before calling bfs_get_data. Returns all dimension variables with their codes and value labels needed to construct data queries. Args: params (GetTableMetadataInput): - table_id (str): BFS table ID, e.g. 'px-x-1504000000_173' - lang (str): Language for labels Returns: str: JSON with table title, source, update date, and all variables with their codes and value options. Use variable codes in bfs_get_data filters. Example output structure: { "title": "Lehrkräfte nach Schuljahr, Kanton...", "variables": [ { "code": "Schuljahr", "label": "Schuljahr", "n_values": 14, "values": [{"code": "0", "label": "2010/11"}, ...] } ] } |
| bfs_get_dataA | Query statistical data from a BFS table with optional filters. Fetches actual data values from a STAT-TAB table. Always call bfs_get_table_metadata first to understand available variables and values. Args: params (GetDataInput): - table_id (str): BFS table ID - filters (Optional[list]): Dimension filters to narrow results. Each filter: {"code": "VariableCode", "values": ["val1", "val2"]} Without filters, all data is returned (may be very large). - lang (str): Language for labels - max_rows (int): Safety limit on returned rows (default 500) Returns:
DataTableResult with |
| bfs_education_statsA | Retrieve Swiss education statistics — convenience tool for Schulamt context. Provides direct access to key education datasets without needing to know table IDs or variable codes. Covers teachers, students, enrollment scenarios, and scholarship data, optionally filtered by canton. Args: params (GetEducationStatsInput): - topic (str): One of: 'teachers', 'students', 'scenarios', 'scholarships' - canton (Optional[str]): Canton name, e.g. 'Zürich'. None = all cantons. - lang (str): Language code Returns:
DataTableResult with |
| bfs_populationA | Retrieve Swiss population statistics by region, year, and breakdown. Accesses the core BFS population dataset (ständige Wohnbevölkerung) with flexible filtering by canton/municipality, year, age, and gender. Critical for school space planning and demographic projections. Args: params (GetPopulationInput): - region (str): 'Schweiz', or canton name like 'Zürich' - year (Optional[str]): Year filter, e.g. '2024' - breakdown (str): 'total', 'age', or 'gender' Returns: str: JSON with population figures for the selected region and breakdown. |
| bfs_compare_cantonsA | Compare a BFS statistical indicator across multiple Swiss cantons. Designed for KI-Fachgruppe demos and benchmarking. Fetches the same dataset for multiple cantons simultaneously, enabling direct comparison. Args: params (CompareCantonsInput): - table_id (str): BFS table ID to query - canton_values (list[str]): Canton value codes to compare. Use '0' for Switzerland total, '1' for Zürich, '2' for Bern, etc. Get codes via bfs_get_table_metadata on any canton-level table. - additional_filters (Optional[list]): Extra dimension filters - lang (str): Language code Returns: str: JSON with data for all selected cantons side by side. Example use case: Compare teacher-to-student ratios across ZH, BE, LU, CH total: canton_values=['0', '1', '2', '3'] |
| bfs_featured_datasetsA | Return a curated list of high-value BFS datasets for Schulamt and public administration. Provides a shortlist of the most relevant datasets for education planning, demographic analysis, and political context — ideal as a starting point. Args: params (ListThemesInput): - lang (str): Language code Returns: FeaturedDatasetsResult with curated table IDs, titles, themes, and recommended use cases. |
| lookup_communeA | Resolve a Swiss commune by name or BFS number, as of a given date. The BFS commune number is the portfolio's join key. This tool returns
the official register entry — BFS number, name, canton, validity dates
and the stable LINDAS URI — for a commune as it existed on Args: params (LookupCommuneInput): - name_or_bfs_number (str): name/substring or BFS number - valid_at_date (str): ISO date; commune state as of this date Returns:
LookupCommuneResult with matching |
| resolve_historical_communeA | Map a historical BFS commune number onto today's number(s). This is the core value of the reference layer: when old statistics are
keyed on a BFS number that has since been merged or renamed, this tool
returns which of today's commune(s) that number resolves to, plus the
mutation path (fusions/renamings with dates). Use Args: params (ResolveHistoricalCommuneInput): - bfs_number (int): historical BFS number - from_date (str): ISO date the old data belongs to - to_date (str): ISO target date (default today) Returns:
ResolveHistoricalCommuneResult with |
| list_communesA | List all communes of a canton, as of a given date. Canton membership is derived from the snapshot's Parent chain
(commune → district → canton), so this reflects the official division
on Args: params (ListCommunesInput): - canton (str): abbreviation ('ZH') or name ('Zürich') - valid_at_date (str): ISO date; default today Returns:
ListCommunesResult with the canton's |
| search_historical_seriesA | Search long-run historical time series (HSSO) by topic. Historical Statistics of Switzerland provides long-run series (roughly 19th–20th century) as static XLSX tables. This tool searches the table catalogue by keyword and returns each match with its page and a stable XLSX download URL. Licence: HSSO is CC BY-NC-SA 3.0 — attribution required, NonCommercial.
Every response carries that notice in Args: params (SearchHistoricalSeriesInput): - topic (str): keyword(s); all must match the title - period (str): optional period hint (informational only) Returns:
SearchHistoricalSeriesResult with matching |
| bfs_construction_activityA | Yearly new buildings and new dwellings for a commune, with room-size mix. Returns the consolidated official annual construction statistics (BFS
STAT-TAB theme 09) for one commune: newly built buildings with dwellings
(px-x-0904030000_106) and newly built dwellings broken down by number of
rooms (px-x-0904030000_105), as a per-year series from Note: this is the consolidated official yearly statistic. For up-to-date
building-register states and the construction pipeline (Baugesuche /
Bauvorhaben), see the Args: params (ConstructionActivityInput): - municipality_bfs (int): BFS commune number, e.g. 261 (Zürich) - since_year (int): earliest year, inclusive (default 2015) Returns:
ConstructionActivityResult with a |
| bfs_construction_investmentA | Yearly building investment and Arbeitsvorrat for a region/canton/commune. Returns building investment (Bauinvestitionen, current year) alongside the
Arbeitsvorrat (work on hand for the following year) from BFS STAT-TAB
px-x-0904010000_205, as a per-year series from Args:
params (ConstructionInvestmentInput):
- level (str): 'grossregion', 'kanton', or 'gemeinde'
- code (str): region/canton/commune code matching Returns:
ConstructionInvestmentResult with a |
| bfs_price_indexA | Swiss price indices not carried by STAT-TAB: Baupreisindex & IMPI.
Data flows through opendata.swiss (CKAN), which rejects default User-Agents with HTTP 403; a custom User-Agent is always sent. Results are cached for 24h. Args: params (PriceIndexInput): - index (str): 'baupreisindex' or 'impi' - since_year (int | None): optional earliest year to include Returns:
PriceIndexResult with |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/malkreide/swiss-statistics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server