Skip to main content
Glama
Aryan-Jhaveri

Statistics Canada MCP Server

get_sdmx_key_for_dimension

Generate a ready-to-use OR key string of all leaf member IDs for a dimension, enabling direct use in get_sdmx_data without manual metadata parsing.

Instructions

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..1", ...)

Input Schema

TableJSON 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.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains what 'leaf' means and shows the return structure via example, including the 'or_key' field and its role in the get_sdmx_data key. It does not mention edge cases or error behavior, but core behavior is transparent.

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 description is well-structured: purpose, use case, definition, example, and integration. Every sentence earns its place, including the example which clarifies expected input/output. Front-loaded with the main action, making it easy to scan.

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?

Despite no output schema, the example provides a complete picture of the return value. The description covers why to use it, when to use it, how it works, and how to apply the result in get_sdmx_data. It is self-contained for the target task.

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% (only dimension_position has description). The description compensates by showing productId in the example and explaining dimension_position via the 'Paste or_key at position 6' note. However, productId itself lacks a direct description beyond the example.

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 verb ('Return') and resource ('leaf member IDs for a single dimension as a ready-to-use OR key string'). It clearly distinguishes itself from siblings like get_sdmx_data (which consumes the key) and get_cube_metadata (which it explicitly avoids).

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?

States exactly when to use it: 'before get_sdmx_data when a dimension has many codes.' It also explains the benefit of avoiding get_cube_metadata, providing an explicit alternative. Includes a concrete example showing how to integrate with get_sdmx_data.

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

Install Server

Other Tools

Latest Blog Posts

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/Aryan-Jhaveri/mcp-statcan'

If you have feedback or need assistance with the MCP directory API, please join our Discord server