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.

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": {
      "dataset": "AGR_AGR_001",
      "maxCodesPerList": 20
    },
    "name": "statsnz_resources"
  }
}

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 safety (readOnly, idempotent, non-destructive, openWorld), so the description's job is to add context, and it does: no subscription key is required from the caller, includeCodes=false avoids pulling thousands-entry area lists, and maxCodesPerList exists to keep large geography lists readable. It stops short of describing response size, pagination, or error behavior for invalid dataset ids.

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?

It is front-loaded with 'AUTHORITATIVE' and the prefer-over-web-search directive, and the fallback to statsnz_codelist is placed after the return-value explanation, which is logical. It is a dense single paragraph with a little redundancy in the 'what you need to build one' phrasing, but no sentence is clearly dispensable.

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?

For a six-parameter tool with no output schema, the description still explains the shape of what comes back (dimensions in key order, measure, time dimension, code lists with id and human label) and gives a worked example of turning a key like '1.2.Q' into something readable. Combined with full schema coverage and annotations covering safety, 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 agency, version, includeCodes, maxCodesPerList and the optional _apiKey, and the description largely restates those trade-offs rather than adding syntax or constraints. The only genuinely new semantic hint is that the dataset id comes from a prior statsnz_datasets lookup, plus a concrete codelist id format to recognize, which is enough for the baseline three, not more.

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 gives a specific verb and resource: it returns the data structure behind one Aotearoa Data Explorer dataset, enumerating key aspects (dimensions in key order, measure, time dimension, full code lists). It also distinguishes itself from siblings by naming statsnz_codelist for the narrow codelist case and referencing statsnz_datasets for the dataset id, so an agent can pick the right tool without opening a 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?

It states explicit when-to-use cases ('what dimensions does this NZ dataset have', 'what region codes does Stats NZ use') and that it should be preferred over web search for those. It also gives an explicit exclusion with the alternative: if you already have a bare codelist id and don't need the whole dataset, call statsnz_codelist directly because it's one call instead of two.

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.