Skip to main content
Glama
nescoffee-create

SDMX MCP Gateway

compare_structures

Compare two SDMX structures to identify differences in codes, references, and versions. Get a summary and visual diff diagram for codelists, dataflows, or data structures.

Instructions

Compare two SDMX structures to identify differences.

Supports comparing different structure types with specialized logic:

**Codelists** (`structure_type="codelist"`):
- Compares actual codes (code IDs and names)
- Shows added/removed/renamed codes
- Perfect for: "What codes changed between CL_GEO v1.0 and v2.0?"

**Data Structure Definitions** (`structure_type="datastructure"`):
- Compares codelist/concept scheme references
- Shows version changes in referenced codelists
- Perfect for: "What codelists were updated in DSD v3.0?"

**Dataflows** (`structure_type="dataflow"`):
- Compares structural references (DSD, constraints)
- Perfect for: "What structures do these dataflows share?"

Args:
    structure_type: Type of structure to compare:
        - "codelist": Compare codes within codelists
        - "datastructure" or "dsd": Compare DSD references
        - "dataflow": Compare dataflow references
        - "conceptscheme": Compare concept schemes
    structure_id_a: First structure identifier
    structure_id_b: Second structure identifier (defaults to same as A for version comparison)
    version_a: Version of first structure (default "latest")
    version_b: Version of second structure (default "latest")
    agency_id: Agency ID (uses current endpoint's default if not specified)
    show_diagram: Generate a Mermaid diff diagram (default True)
    endpoint: Optional endpoint key (e.g. "FBOS", "ECB") to target a
        specific provider for this call only. Defaults to the session's
        current endpoint.

Returns:
    StructureComparisonResult with type-specific changes:
        - code_changes: For codelist comparisons
        - reference_changes: For DSD/dataflow comparisons
        - summary: Counts of added/removed/modified/unchanged
        - mermaid_diff_diagram: Visual diff diagram
        - interpretation: Human-readable explanation

Examples:
    # Compare two versions of a codelist - see what codes changed
    >>> compare_structures("codelist", "CL_GEO", version_a="1.0", version_b="2.0")

    # Compare two different codelists - find intersection/differences
    >>> compare_structures("codelist", "CL_FREQ", "CL_TIME_FREQ")

    # Compare DSD versions - see what codelist references changed
    >>> compare_structures("datastructure", "DSD_SDG", version_a="2.0", version_b="3.0")

    # Compare two different DSDs
    >>> compare_structures("datastructure", "DSD_SDG", "DSD_EDUCATION")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointNo
agency_idNo
version_aNolatest
version_bNolatest
show_diagramNo
structure_id_aYes
structure_id_bNo
structure_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoAdditional notes or warnings
summaryYesSummary counts of changes
structure_aYesFirst structure being compared
structure_bYesSecond structure being compared
code_changesNoChanges in codes (for codelist comparisons)
api_calls_madeYesNumber of SDMX API calls made
interpretationYesHuman-readable explanation of the differences
structure_typeNoType of structures being compared: 'codelist', 'conceptscheme', 'datastructure', 'dataflow'generic
comparison_typeYesType of comparison: 'version_comparison' or 'cross_structure'
concept_changesNoChanges in concepts (for concept scheme comparisons)
discovery_levelNoDiscovery workflow levelstructure_comparison
dimension_changesNoChanges in dimensions (for DSD comparisons)
reference_changesNoChanges in structural references (codelists, concept schemes referenced)
mermaid_diff_diagramNoMermaid diagram highlighting differences (green=added, red=removed, yellow=changed)
Behavior4/5

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

With no annotations present, the description carries the full burden. It explains default behaviors (version_a/b default to 'latest', structure_id_b defaults to same as A for version comparison), how agency_id uses the current endpoint's default, endpoint override semantics, and the return object's type-specific fields. It does not explicitly state that the operation is non-destructive, but 'compare' strongly implies it, and no side effects are hinted.

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 with bold headers, a clear overview, per-type sections, a structured Args list, a Returns field list, and examples. It is longer than average but every section is necessary given the 8 parameters and multiple comparison modes. The core purpose is front-loaded, and the markdown formatting aids scanning.

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?

This is a complex tool with 8 parameters and multiple structure types, yet the description covers all angles: purpose, type-specific behavior, all parameters with semantics, return fields, and examples. Even though an output schema exists, the description already details the return object structure, making the agent well-prepared to interpret results.

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 provides only types and defaults with 0% description coverage. The description's Args section compensates fully: it explains the meaning and allowed values for structure_type, clarifies that structure_id_b defaults to same as A (a key semantic not in the schema), and describes the endpoint override and agency_id defaults. The examples further illustrate parameter combinations for each type.

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 and resource: 'Compare two SDMX structures to identify differences.' It then provides specialized logic for codelists, DSDs, and dataflows, each with concrete examples like 'What codes changed between CL_GEO v1.0 and v2.0?' This clearly distinguishes it from sibling tools like get_codelist or compare_dataflow_dimensions.

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 gives explicit 'Perfect for:' scenarios for each structure type, telling the agent when to invoke the tool for version comparisons, cross-structure comparisons, and reference checks. It does not explicitly name alternative tools or exclusions, but the context is clear and actionable for each mode.

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/nescoffee-create/sdmx-mcp-gateway'

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