Skip to main content
Glama
markusl

Tilastokeskus StatFin MCP Server

by markusl

Get All Values for a Variable

get_variable_values
Read-onlyIdempotent

Fetch all values for a StatFin variable when metadata shows only the first 20. Use search to filter and locate specific region codes, years, or categories.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoFilter values containing this text. Example: "Helsinki" returns only Helsinki-related codes.
tableIdYesTable ID. Example: "11re.px"
languageNoLanguage for value names. Default "fi".fi
variableYesExact variable code from get_table_metadata (table-specific and version-stamped, e.g. "alue_23_20260101", "timeperiod_y"). The region variable usually starts with "alue"; the time variable is often "timeperiod_y". Do not guess.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesTotal number of values for this variable
valuesYesAll values for this variable (filtered if search was used)
variableYesThe variable code that was queried
commonCodesNoCommon code patterns for region variables (wholeCountry, regions, municipalities)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover readonly/idempotent/non-destructive behavior, so the description adds value by explaining that it returns a complete list beyond the metadata's first 20. It also provides concrete behavioral context (e.g., common region codes and search filter behavior) that helps set expectations about the output. No contradictions with annotations.

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

Conciseness4/5

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

The description is well-structured and front-loaded with the core purpose first. It uses bullet points for readability and groups related information (useful cases, region codes). It is a bit longer than strictly necessary, but every sentence adds practical value—examples and codes are not filler. The structure makes it scannable for an agent.

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?

For a read-only value-list tool with an output schema, the description is thorough. It covers the primary use cases, gives concrete examples of how to use the search filter, and provides domain-specific knowledge (region codes, year range 1972–2024) that an agent would otherwise lack. The existence of an output schema reduces the need to describe return structure. No critical information is missing.

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

Parameters5/5

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

The schema already describes all parameters with 100% coverage (baseline 3). The description goes well beyond by explaining variable code patterns (e.g., 'alue_23_20260101', 'timeperiod_y'), providing common region codes (e.g., KU091, MK01), and showing the search parameter example with 'Helsinki'. This enriches the schema's bare definitions and helps the agent choose correct parameter values.

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 opens with a specific, actionable purpose: 'Get the complete list of values for a variable when metadata only shows first 20.' This clearly distinguishes it from metadata retrieval (get_table_metadata) which provides a truncated list. The 'Useful for' bullets further clarify the intended use cases (region codes, year lists, category codes), leaving no ambiguity about what the tool does.

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

Usage Guidelines4/5

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

The description states when to use the tool: when metadata only shows the first 20 values. This implicitly contrasts with get_table_metadata, but it does not name alternatives or explicitly say not to use other tools. It gives clear context for the typical scenarios (finding region codes, years, category codes) but lacks explicit 'when not to use' guidance or reference to sibling tools.

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