Skip to main content
Glama
nescoffee-create

SDMX MCP Gateway

get_code_usage

Check whether specific codes have data in a dataflow without running data queries. Get usage status for listed codes or retrieve all used codes per dimension.

Instructions

Efficiently check if specific codes are actually used in a dataflow's data.

This uses the Actual ContentConstraint (if available) to determine which
codes have real data, WITHOUT iterating through data queries. This is
much faster than trial-and-error data requests.

Use cases:
- "Is country code 'FJ' actually used in DF_SDG?"
- "Which indicator codes have data?" (leave codes empty)
- "Are these 5 codes I want to use valid AND have data?"

Args:
    dataflow_id: The dataflow to check
    codes: Optional list of specific codes to check. If empty, returns all used codes.
    dimension_id: Optional dimension to check. If empty, checks all dimensions.
    agency_id: The agency (uses session endpoint if not specified)
    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:
    CodeUsageResult with:
        - codes_checked: List of codes with their usage status
        - all_used_codes: All codes that have data (by dimension)
        - summary: Counts of used/unused codes

Examples:
    >>> get_code_usage("DF_SDG", codes=["FJ", "WS", "XX"], dimension_id="GEO_PICT")
    # Checks if Fiji, Samoa, and "XX" have SDG data

    >>> get_code_usage("DF_SDG", dimension_id="INDICATOR")
    # Returns all indicator codes that actually have data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codesNo
endpointNo
agency_idNo
dataflow_idYes
dimension_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYesSummary counts: total_checked, used, unused
dataflow_idYesDataflow checked
dimension_idNoDimension checked (if specific)
codes_checkedYesUsage status for each code
constraint_idNoActual constraint used
all_used_codesNoAll codes with actual data per dimension (if no specific codes requested)
api_calls_madeNoNumber of API calls made
interpretationYesHuman-readable explanation
discovery_levelNoDiscovery workflow levelcode_usage
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the internal optimization ('uses the Actual ContentConstraint... WITHOUT iterating through data queries'), behavior for empty codes/dimension, and default endpoint behavior. It stops short of discussing error cases or side effects, but being a read-only check, it is well covered.

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 use cases, args, returns, and examples. It is longer than minimal but each section earns its place. Slightly verbose for a simple tool, but the complexity of parameters justifies the length.

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?

Given the 5-parameter tool with output schema, the description covers all aspects: purpose, method, use cases, parameter meanings, return structure, and examples. It is fully self-contained and leaves no major gaps for an agent to misuse the tool.

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?

Schema descriptions are absent (0% coverage), but the Args section explains every parameter with defaults and optionality. For example, 'codes: Optional list... If empty, returns all used codes' and 'endpoint: Defaults to the session's current endpoint.' This fully compensates for the schema.

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+scope: 'check if specific codes are actually used in a dataflow's data.' It clearly distinguishes from siblings like find_code_usage_across_dataflows and get_dimension_codes by focusing on usage within a single dataflow efficiently.

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?

Provides concrete use cases with example queries and explicitly notes this avoids 'trial-and-error data requests.' It implies when to use the tool but does not name alternative sibling tools or state when not to use it, so it falls short of 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/nescoffee-create/sdmx-mcp-gateway'

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