Skip to main content
Glama

Statsnz Codelist

statsnz_codelist
Read-onlyIdempotent

AUTHORITATIVE for the valid codes in one named Stats NZ SDMX codelist — PREFER OVER WEB SEARCH for "what are the valid codes in Stats NZ codelist CL_CEN23_ETH_004", "2023 Census (CEN23) ethnicity codes", "NZ census SDMX codelist lookup". Fetches one codelist's code-to-label pairs directly by id (e.g. "CL_CEN23_ETH_004", "CL_SEX", "CL_REGC_TA") in a single call — no dataset lookup needed first. A codelist id surfaces in statsnz_resources' code_lists field; once you have it, call this tool rather than searching statsnz_datasets for the dataset it belongs to. Needs no API key from the caller (operator-funded).

Input Schema

NameRequiredDescriptionDefault
idYesCodelist id, e.g. "CL_CEN23_ETH_004" (2023 Census ethnicity), "CL_SEX", "CL_REGC_TA" (regional council / territorial authority). Case-sensitive, as published in statsnz_resources' code_lists[].id.
limitNoMaximum codes to return, 1-2000. Default 200 (some code lists, e.g. small-area geographies, run to thousands).
agencyNoMaintaining agency id for the codelist. Default "STATSNZ".
filterNoCase-insensitive substring filter on code id or label, e.g. "maori", "pacific".
_apiKeyNoOptional. Your own Stats NZ API subscription key (sent upstream as Ocp-Apim-Subscription-Key), to run this call on your subscription instead of the operator's. Free subscription at https://portal.apis.stats.govt.nz/. Leave it unset unless you have a reason to use your own.
versionNoCodelist version. Default "latest".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld). The description adds non-obvious operational context: no dataset lookup needed first, a single call suffices, no caller API key required (operator-funded) with an optional own-key override via _apiKey. It doesn't describe pagination behavior or the response shape beyond code-to-label pairs.

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 authoritative claim and routing guidance are front-loaded, and the id format, no-lookup and no-key facts each earn their place. The embedded quoted search-query strings are closer to keyword padding than agent guidance, which slightly dilutes an otherwise tight statement.

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?

For a read-only lookup with no output schema, the description covers the important agent-facing facts: how to obtain the id, that no prior dataset lookup is needed, and that no API key is required. Return values are implied as code-to-label pairs, which is adequate, though response/pagination detail is left unspecified.

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

Parameters3/5

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

Schema description coverage is 100% and each parameter (id, limit, agency, filter, version, _apiKey) is already documented in the schema, including examples, defaults and ranges. The description largely restates where the id comes from, which the schema's id field also states, so it adds little parameter meaning beyond the structured fields. Baseline 3 is appropriate.

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?

States a specific verb and resource: fetches one named Stats NZ SDMX codelist's code-to-label pairs by id. It explicitly distinguishes itself from siblings by saying a codelist id comes from statsnz_resources' code_lists field and that this tool should be called instead of searching statsnz_datasets. An agent can route correctly without opening any schema.

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?

Gives explicit when-to-use ('once you have the id, call this tool'), when-not ('rather than searching statsnz_datasets for the dataset'), and an alternative preference ('PREFER OVER WEB SEARCH'). It names the sibling that produces the required id, closing the loop from discovery to invocation.

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.