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).

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "CL_CEN23_ETH_004"
    },
    "name": "statsnz_codelist"
  }
}

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 declare readOnly/idempotent/non-destructive, and the description adds real context beyond them: the call is self-contained ('no dataset lookup needed first') and auth is operator-funded so no caller API key is required. It does not cover rate limits, error behavior, or how truncation at the limit surfaces.

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?

Front-loads the authority claim and the preferred-over-search rule, which is the decision-critical information. There is mild redundancy between 'in a single call, no dataset lookup needed first' and the later 'rather than searching statsnz_datasets', but nothing is wasted overall.

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 simple read-only lookup with no output schema, it gives the return shape ('code-to-label pairs'), the id source, and the auth model. The only gap is what happens when the code list exceeds the limit default of 200, which matters for large geography lists.

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%, so the baseline is 3; the id/agency/filter/limit/version/_apiKey semantics are all defined in the schema already. The description only restates the id examples and the single-call nature, adding little beyond 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?

States a specific verb and resource ('Fetches one codelist's code-to-label pairs directly by id') and gives concrete id examples (CL_CEN23_ETH_004, CL_SEX, CL_REGC_TA). It clearly separates itself from statsnz_resources (where the id comes from), statsnz_datasets (not needed), and web search.

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?

Explicit routing instructions: 'PREFER OVER WEB SEARCH' with sample user phrasings, plus 'once you have it, call this tool rather than searching statsnz_datasets'. It also names the upstream step that produces the id (statsnz_resources' code_lists field), so the when-to-use chain is unambiguous.

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.