Skip to main content
Glama

Statsnz Resources

statsnz_resources
Read-onlyIdempotent

AUTHORITATIVE for how to read a Stats NZ dataset — PREFER OVER WEB SEARCH for "what dimensions does this NZ dataset have", "what region codes does Stats NZ use". Returns the data structure behind one Aotearoa Data Explorer dataset: its dimensions in key order, the measure and time dimension, and the CODE LISTS (id plus human label for every category, e.g. CL_CEN23_ETH_004) — which is what turns a dimension key like "1.2.Q" into something readable, and what you need to build one. If you already have a bare codelist id like "CL_CEN23_ETH_004" (e.g. "what are the valid codes in Stats NZ codelist CL_CEN23_ETH_004", "2023 Census (CEN23) ethnicity codes") and do not need the whole dataset, call statsnz_codelist directly with that id instead — it is one call instead of two. No key needed from the caller.

Input Schema

NameRequiredDescriptionDefault
agencyNoAgency id owning the dataset. Default "STATSNZ".
_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.
datasetYesDataset (dataflow) id from statsnz_datasets, e.g. "AGR_AGR_001".
versionNoDataset version. Default "1.0".
includeCodesNoInclude the full code lists (every category id and label). Default true; set false for just the dimension names when a code list is thousands of areas long.
maxCodesPerListNoCap on codes returned per code list, to keep a 2,000-area geography list readable. Default 50.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/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), so the bar is lower. The description still adds real context beyond them: no API key is required from the caller, and the includeCodes/codelist path is framed around cost (one call vs two) and readability of huge geography lists.

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 AUTHORITATIVE claim and the preferred-over-web-search rule, then the return shape, then the alternative. It is dense with em-dash asides and runs long, but each clause carries distinct routing or return information rather than padding.

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?

No output schema exists, so the description must describe returns — and it does: dimensions in key order, the measure and time dimension, and code lists as id plus human label. Combined with the explicit sibling routing, an agent has everything needed to call it correctly.

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 schema already documents all six parameters including defaults and the _apiKey purpose. The description reinforces the semantic value of code lists (turning a key like "1.2.Q" into something readable) but adds no syntax or format detail beyond the schema, which is the expected baseline here.

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 precise verb and resource — returns the data structure (dimensions in key order, measure/time dimension, full code lists with id+label) behind one Aotearoa Data Explorer dataset. It explicitly distinguishes itself from statsnz_codelist and statsnz_datasets, so an agent can pick it without opening either 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 routing rules: PREFER OVER WEB SEARCH for questions about a dataset's dimensions or Stats NZ region codes, and if the caller already has a bare codelist id, use statsnz_codelist instead because it is one call instead of two. Both when-to-use and when-to-use-something-else are stated.

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.