Skip to main content
Glama
markusl

Tilastokeskus StatFin MCP Server

by markusl

Get Table Structure

get_table_metadata
Read-onlyIdempotent

Inspect a StatFin table's structure before querying: get variable codes, value codes, required fields, and available combinations. Use it to find exact codes for query_table.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableIdYesTable ID from search_statistics. Example: "11re.px"
languageNoLanguage for variable/value names. Default "fi".fi
includeAllValuesNoIf true, return ALL value codes (can be 300+ for regions). Default false shows first 20.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesHuman-readable table title
tableIdYesThe table ID
variablesYesAll variables in this table
lastUpdatedYesWhen the data was last updated (ISO format)
queryGuidanceYesTips for constructing an efficient query
totalCombinationsYesTotal possible data cells (product of all value counts)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: it explains that variable codes are table-specific and version-stamped, that value codes can be numerous (300+), and that includeAllValues defaults to showing only the first 20. This goes beyond what annotations provide.

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 with a clear opening sentence, a bulleted list of what the output shows, and a concrete example. It's slightly longer than strictly necessary but every section earns its place by conveying critical usage information. The 'REQUIRED before querying' callout is front-loaded and effective.

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?

The description is complete for a read-only metadata tool. It explains the purpose, the prerequisite relationship to query_table, the nature of the output (codes, values, required/optional), and the scale of data. The output schema exists, so return values don't need to be described in detail. The only minor gap is not explaining what 'total possible data combinations' means precisely, but this is a minor omission given the overall completeness.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters (tableId, language, includeAllValues). The description adds context about the meaning of the output (variable codes, value codes) and the scale of values, but doesn't add much parameter-specific detail beyond the schema. Baseline 3 is appropriate.

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 the tool's purpose: retrieving table structure including variable codes, value codes, required vs optional variables, and data combinations. It explicitly distinguishes itself from query_table by positioning this as the prerequisite step before querying. The verb 'get' plus the specific resource 'table metadata/structure' is unambiguous.

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?

The description explicitly says this is REQUIRED before querying, and instructs the agent to use query_table afterward with the exact codes from this output. It also warns against assuming or reusing codes from another table, providing clear when-to-use guidance and routing to the correct sibling tool.

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