Skip to main content
Glama
Aryan-Jhaveri

Statistics Canada MCP Server

get_sdmx_structure

Discover the structure of any Statistics Canada table: get dimension codelists, code IDs, and hierarchy to build correct SDMX keys for your data queries.

Instructions

Fetch the Data Structure Definition (DSD) for a StatCan table via SDMX REST.

Returns dimension codelists with code IDs, names, and parent hierarchy. Use this BEFORE get_sdmx_data to understand the key syntax for that table.

Each dimension entry includes:

  • id: dimension identifier (e.g. "Geography")

  • position: its slot in the dot-separated key string (1-based)

  • codelist: the SDMX codelist ID (e.g. "CL_Geography")

  • codes: list of {id, name, ?parent} — truncated to 10 for large codelists

  • _code_count / _truncated: total size and truncation flag

Key construction rules:

  • "1.2.1" = position-1 code 1, position-2 code 2, position-3 code 1

  • ".2.1" = wildcard position 1 (all geographies), Gender=2, Age=1

  • "1+2.2.1" = Geography 1 or 2 (OR syntax)

  • WDS memberIds == SDMX codelist codes — no translation needed

IMPORTANT: In your final response to the user, you MUST cite the source of your data. This means including the _sdmx_url.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYes
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and discharges it well: it discloses truncation behavior (codes truncated to 10, _code_count and _truncated flags), key syntax including wildcard and OR operators, and the mandatory requirement to cite _sdmx_url in the final response. This goes far beyond a generic 'fetch data' statement.

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 longer than average but well-structured with a lead sentence, a bullet list for dimension entries, and key construction rules. Each section adds needed domain knowledge (truncation, key syntax, citation). It earns its length, though a few details (like the truncated-code note) could arguably be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and annotations, the description covers the essential return shape, truncation, key syntax, and source-citation requirement. The only notable gap is the unexplained productId parameter, which prevents full completeness for an agent trying to invoke the tool blindly.

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

Parameters2/5

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

The input schema only exposes productId (integer) with no description and coverage is 0%. The description refers to 'a StatCan table' but never explicitly maps productId to the table identifier or explains how to discover valid values. The schema and description leave the single parameter under-documented.

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-resource pairing: 'Fetch the Data Structure Definition (DSD) for a StatCan table via SDMX REST.' It clearly distinguishes this from sibling tools by stating it should be used before get_sdmx_data and by describing the DSD-specific output (dimension codelists, code IDs, parent hierarchy).

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?

Explicitly states 'Use this BEFORE get_sdmx_data to understand the key syntax for that table,' giving clear contextual placement. It also includes key construction rules that explain how the output is consumed downstream. It does not mention conditions where one would not use it or alternative tools, so slightly below a 5.

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