legislation-nz-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEGISLATION_HTTP_HOST | No | Bind address for the HTTP transport (default 127.0.0.1). | 127.0.0.1 |
| LEGISLATION_HTTP_PORT | No | Port for the HTTP transport (default 8091). | 8091 |
| LEGISLATION_NZ_API_KEY | Yes | Key for the JSON API (10,000 requests/day). | |
| LEGISLATION_NZ_RSS_API_KEY | No | RSS-only key for the two feed tools (1,500 requests/day). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_legislationA | Search New Zealand legislation (acts, bills, secondary legislation, amendment papers) by title or full-text content, or browse by omitting search_term and using filters alone. Returns matching works with their newest matching version id, website URLs, publisher, and available formats. latest_matching_version_is_latest is false when a content search matched only an older version (e.g. text since repealed). Type-specific filters (act_*, bill_*, instrument_*) imply legislation_type; mixing types is rejected. Ids containing ~ are ephemeral and carry ephemeral: true. Use this first to find a work_id or version_id. |
| list_versionsA | List all point-in-time versions of a work (identified by work_id), newest first by default, each with its website URL; the newest carries is_latest_version: true. Work-level metadata (title, type, status, agencies) is reported once at the top rather than repeated per version. Fetches every page automatically (the API serves at most 100 per page); pass page (and optionally per_page) to fetch a single page instead. Use this to find a version_id for a specific date. |
| get_version_detailsA | Get metadata for a single version, including the list of available document formats (html, pdf, xml) and their URLs. |
| get_legislation_textA | Retrieve the text of a piece of legislation. Provide a version_id or work_id. Without section/schedule params, returns the whole document as cleaned plain text. With a section param (e.g. "22" or "25A"), returns just that section with its Part/subpart context. With a schedule param (e.g. "1"), returns just that schedule. Use list_sections to discover numbers first. With format:"pdf", returns the official PDF download URL instead of text; format:"pdf_original_scan" returns the scan of the original printed Act (pre-2008 as-enacted versions only). |
| list_sectionsA | List the structure of a legislation document: Parts, subparts, section numbers and headings, and schedules. Use this before get_legislation_text to find the right section or schedule number. |
| search_legislation_rssA | Search New Zealand legislation through the legacy Atom feed (the documented /api/rss/search/ endpoint) by title or full text, with type and status filters; omit search_term to browse by filters alone. Returns up to 100 feed entries (title, website URL, derived work_id/version_id, timestamps) plus a subscribable feed URL. Needs LEGISLATION_NZ_RSS_API_KEY, a separate RSS-only key. For on-demand queries prefer search_legislation, which is a superset. |
| list_versions_rssA | Read the legacy Atom feed of a work's versions (the documented /api/rss/works/{work_id}/versions/ endpoint). Returns one entry per version with its website URL, derived version_id, and publication timestamp, plus a subscribable feed URL for change monitoring. Needs LEGISLATION_NZ_RSS_API_KEY, a separate RSS-only key. For on-demand queries prefer list_versions. |
| get_rate_limit_statusA | Report remaining daily quota from the X-RateLimit-* response headers: the JSON API key (10,000 requests/day) and the feed key (1,500 requests/day). Quotas reset at midnight NZ time. By default spends one minimal API request to get fresh numbers; refresh:"none" returns the values last observed. The separate burst limit of 2,000 requests per 5 minutes per IP is not reported in headers. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: searching vs listing versions vs retrieving text vs structure vs rate limits. The RSS variants are explicitly marked as legacy alternatives and are superseded by their modern counterparts, so no ambiguity remains.
All tools follow a consistent snake_case verb_noun pattern (search_, list_, get_). The _rss suffix is applied uniformly to the two RSS-specific tools, and the rest follow the same style without deviation.
8 tools is well-scoped for a legislation retrieval server. Each tool serves a distinct need—search, version enumeration, metadata, text, structure, RSS alternatives, and quota monitoring—without unnecessary bloat.
The tool surface covers the full read-only lifecycle: discovery (search, browse), version exploration, document retrieval in multiple formats, structure navigation, and rate limit monitoring. No obvious gaps exist for the domain; even PDF downloads and legacy RSS access are included.