Skip to main content
Glama

Statistics Canada MCP Server

get_sdmx_key_for_dimension

Read-only

Return all leaf member IDs for a single dimension as a ready-to-use OR key string.

Use this before get_sdmx_data when a dimension has many codes (e.g. 162 NOC minor groups, hundreds of CMA geographies). Avoids the need to call get_cube_metadata and manually parse a large JSON response.

Leaf codes are codes with no children — the lowest-level members in a hierarchy. For flat (non-hierarchical) codelists every code is a leaf.

Example: get_sdmx_key_for_dimension(productId=98100452, dimension_position=6) → { "dimension_id": "Occupation_...", "dimension_name": "Occupation - Minor group - NOC 2021", "position": 6, "leaf_count": 162, "total_count": 309, "or_key": "7+11+12+13+16+18+21+23+...", "note": "Paste or_key at position 6 in your get_sdmx_data key." }

Then use the or_key directly: get_sdmx_data(productId=98100452, key="7.3.1.1.1.<or_key>.1", ...)

Input Schema

NameRequiredDescriptionDefault
productIdYes
dimension_positionYes1-based position of the dimension in the SDMX key (use get_sdmx_structure to find positions). E.g. position=6 for the 6th dot-separated slot.

Output Schema

NameRequiredDescriptionDefault
noteYes
or_keyYes'+'-joined leaf codes, ready to paste at `position` in the key.
positionYes
leaf_countYes
total_countYes
dimension_idNo
dimension_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description goes well beyond the read-only/open-world annotations by defining leaf codes, noting that flat codelists make every code a leaf, and showing the returned fields including leaf_count, total_count, and or_key. It also explains how the or_key should be inserted into a get_sdmx_data key.

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

Conciseness5/5

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

The purpose and usage guidance are front-loaded, followed by leaf-code semantics and a concrete example. The example output and follow-on get_sdmx_data usage are directly useful rather than filler.

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 two-parameter helper with an output schema, the description supplies enough context to call the tool correctly and to use its result in get_sdmx_data. It fills the main semantic gap around leaf membership and key construction.

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

Parameters4/5

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

Schema coverage is only 50%, so the description must carry more weight. It provides a concrete example using productId and dimension_position and explains that dimension_position is the 1-based slot found via get_sdmx_structure, though productId itself is only demonstrated rather than explicitly defined.

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 states a specific verb and resource: return all leaf member IDs for a single SDMX dimension as an OR key string. It clearly distinguishes this tool from get_sdmx_data, get_cube_metadata, and get_sdmx_structure by explaining its preparatory role.

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?

It explicitly says to use this before get_sdmx_data when a dimension has many codes, and explains that doing so avoids calling get_cube_metadata and parsing a large JSON response. The schema also points agents to get_sdmx_structure for finding dimension positions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.