MCP server for Statistics Finland StatFin database providing access to Finnish statistical tables
StatFin MCP demonstrates strong definition quality overall. All 7 tools are explicitly registered with names, descriptions, input schemas, and output schemas. Tool names follow clear verb_noun patterns (search_, list_, get_, query_). Descriptions are comprehensive and LLM-optimized, ranging from 150-600 characters with clear workflow guidance and examples. All parameters include type definitions and descriptions. Tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) are properly declared. However, there are notable gaps: output schemas are declared but not fully visible in the provided source excerpt (only input schemas shown), parameter validation rules could be more explicit (e.g., enum values for 'filter' param in query_table), and error handling guidance is minimal. The server targets a specialized domain (Finnish statistics) with strong contextual descriptions that help LLMs understand when and why to call each tool.
Get server health, rate limit status, and cache statistics. Use when: - Queries are failing or slow - Need to check remaining API quota - Debugging connection issues Rate limit: 8 requests per minute per instance.
Get the structure of a table: what variables it has and what values are available. REQUIRED before querying - shows you: - Variable codes (table-specific and version-stamped, e.g. "alue_23_20260101" for region, "timeperiod_y" for the time variable). Always read these here - never assume or reuse codes from another table. - Value codes (KU091=Helsinki, SSS=Total, 2024=year 2024) - Which variables are required vs optional - Total possible data combinations Example: a region variable may have 300+ values, a year variable 50+. After understanding the structure, use query_table with the exact codes from this output.
Get the complete list of values for a variable when metadata only shows first 20. Useful for: - Finding specific region codes (KU091=Helsinki, MK01=Uusimaa region) - Getting all available years (1972-2024) - Finding specific category codes Common region codes: - SSS = Whole country (Finland) - MK01-MK19 = Regions (maakunta) - KU091 = Helsinki, KU049 = Espoo, KU837 = Tampere Use search parameter to filter: search="Helsinki" returns only matching values.
List all 149 subject areas (topics) in StatFin database. Use this to explore what statistics are available when you don't have a specific search term. Topic examples: - vaerak: Population structure - tyti: Labor force - ashi: Housing prices - synt: Births and deaths - muutl: Migration After finding an area, use list_tables to see all tables in that topic.
Output schemas declared but not fully visible in source code. searchStatisticsOutputSchema, getTableMetadataOutputSchema, etc. are imported but their structure is not shown in the provided excerpt, making it impossible to verify completeness of returned fields.
query_table 'filter' parameter is documented as accepting enum values ['item', 'all', 'top'] but these are shown in description text rather than as formal enum constraint in the schema. LLMs may not reliably parse the constraint from narrative descriptions.
Error handling guidance is minimal. Tools document what they return on success but lack 'what to do if it fails' guidance. For example, search_statistics has no explicit recovery path if a query returns no results or if rate limits are hit (rate limit: 8/min is mentioned in get_api_status but not in individual tool descriptions).
Inferred effective spec: 2025-06-18+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-21 | B | 70 | 2025-06-18+ | v2 |
| 2026-03-09 | C | 64 | - | v1 |
List all statistical tables within a subject area. Each area typically has 20-40 tables with different data views. Common subject areas: - "vaerak" → 30+ population tables (age, gender, region, etc.) - "tyti" → 35+ employment tables (employment rate, unemployment, etc.) - "ashi" → 15+ housing price tables Use list_subject_areas first to find the area ID, or use search_statistics for direct search.
Execute a query to retrieve actual statistical data from a table. WORKFLOW: search_statistics → get_table_metadata → query_table Selection types: - filter: "item" + values: ["KU091", "2024"] → specific values - filter: "top" + top: 5 → latest 5 values (good for time variables) - filter: "all" → all values (use carefully, can be large!) Example - Helsinki population for last 5 years (the variable codes below are from table 11re.px; YOUR table's codes WILL differ - always read them from get_table_metadata first, never reuse these): { "tableId": "11re.px", "selections": [ {"variable": "alue_23_20260101", "filter": "item", "values": ["KU091"]}, {"variable": "timeperiod_y", "filter": "top", "top": 5}, {"variable": "sukupuoli_9_20180101", "filter": "item", "values": ["SSS"]}, {"variable": "ikaryhma_10_20180101", "filter": "item", "values": ["SSS"]}, {"variable": "contentscode", "filter": "item", "values": ["vaerak-vaesto"]} ] } IMPORTANT: Variable codes are table-specific; get them from get_table_metadata. Use VALUE CODES (KU091, SSS), not labels (Helsinki, Total).
Search Statistics Finland's StatFin database for statistical tables by keyword. USE THIS FIRST when looking for data. Returns ranked results with relevance scores. Examples: - "väestö Helsinki" → population tables for Helsinki - "unemployment" → employment/labor market tables - "housing prices" → real estate statistics Returns: tableId (needed for query_table), title, relevance score, publication date. After finding a table, use get_table_metadata to see its structure before querying.
get_api_status description is brief (53 chars) and does not clearly explain when/why an LLM should call it as part of a workflow. It reads like debug-only utility rather than a first-class discovery tool.
query_table requires exact variable codes and value codes from get_table_metadata (e.g., 'alue_23_20260101'). While the description emphasizes this requirement and warns against reusing codes, there is no validation or error message if an LLM passes an incorrect code. A clear 'Variable code not found in table. Available codes: ...' error would aid recovery.