Skip to main content
Glama
ezydubs
by ezydubs

search_legislation

Search New Zealand legislation by title or full-text content, or browse with filters to find acts, bills, and secondary legislation with version details and links.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1).
sort_byNoResult ordering.
act_typeNoRestrict acts to a subtype (e.g. public vs local/private). Acts only; implies legislation_type "act".
per_pageNoResults per page (default 20, max 100).
bill_typeNoRestrict bills to a type. Bills only; implies legislation_type "bill".
publisherNoRestrict by the publishing body.
act_statusNoRestrict acts by their current legislative standing. Acts only; implies legislation_type "act".
bill_statusNoRestrict bills by their current status. Bills only; implies legislation_type "bill".
search_termNoSearch phrase. Supports ElasticSearch simple query syntax (e.g. "privacy", "data +breach"); stemming is on by default, wrap a phrase in double quotes to disable it. Omit it to browse: the filters alone (or no filters at all) list every matching work.
search_fieldNoSearch titles only, or full document content. Defaults to the API default (title).
legislation_typeNoRestrict to a category of legislation. Inferred automatically when an act_*, bill_*, or instrument_* filter is given.
instrument_statusNoRestrict secondary legislation by its current status. Secondary legislation only; implies legislation_type "secondary_legislation".
act_classificationNoRestrict acts to principal (foundational) or amendment acts. Acts only; implies legislation_type "act".
legislation_statusNoRestrict by whether the legislation is currently in force.
instrument_type_groupNoRestrict secondary legislation to an instrument type group. Secondary legislation only; implies legislation_type "secondary_legislation".
administering_agenciesNoFilter by administering agency. Must be the agency's full name exactly as listed at https://www.legislation.govt.nz/browse/agencies (e.g. "Ministry of Justice").
instrument_classificationNoRestrict secondary legislation to principal or amendment instruments. Secondary legislation only; implies legislation_type "secondary_legislation".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses meaningful quirks: ephemeral ids (~) carry ephemeral:true, latest_matching_version_is_latest is false when only an older version matched, and type-specific filters imply legislation_type. It does not cover rate limits or auth, but for a read/search tool these are less critical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five sentences pack a large amount of information: scope, modes, return fields, a subtle result-field condition, filter interaction, ephemeral-id handling, and a usage priority hint. No filler or redundant restatement of schema details.

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?

This is a 17-parameter tool with no output schema and no annotations, but the description covers the essential behavioral nuances and result fields. Pagination/sorting defaults are left to the schema, which is acceptable. It gives an agent enough context to select and invoke the tool correctly in most situations.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds cross-parameter semantics beyond individual schema entries: type-specific filters imply legislation_type and cannot be mixed, and browsing is achieved by omitting search_term. The Elasticsearch syntax and stemming note already appears in the schema, so the added value is useful but modest.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Search') and resource ('New Zealand legislation'), enumerating the categories and the two operation modes (search vs browse). It clearly describes the return fields. It doesn't explicitly contrast with the sibling search_legislation_rss, but the 'Use this first to find a work_id or version_id' hint helps define its role among the siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use this first to find a work_id or version_id' and explains when to browse (omit search_term, use filters alone). It also warns that mixing type-specific filters is rejected. Missing: does not name alternatives for other tasks (e.g., list_versions, get_legislation_text), so the routing guidance is incomplete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.