Skip to content
Book a demo

Tools

search_library

search_librarySearch the Nylon legal library

  • Read-only
  • Non-destructive
  • Closed world

Searches Nylon’s library of New Zealand, Australian and UK legislation, cases and commentary. One call runs up to five searches in parallel, filtered by jurisdiction, content type, practice area and date. Each result carries an extract, identifiers for a follow-up read, and a link to the source in Nylon.

Description sent to the assistant

Search the Nylon legal library (legislation, cases, and commentary across NZ, AU and the UK).

WHEN TO USE: Call this tool whenever a question could possibly require tax or legal knowledge — including statutes, regulations, case law, legal procedure, compliance, contracts, tax rules/rates/filing, or any "is this allowed / what does the law say" question. Do NOT answer from memory for these; your training data may be outdated, jurisdiction-specific, or wrong. If there is any doubt about whether a question touches law or tax, search first. It is better to search unnecessarily than to give an unsourced legal or tax answer.

Provide one or more `searches` (max 5) — they run in parallel and each returns one batch of fused results (starting from the first result by default). Pass `offset` to skip results and `limit` to change the batch size; when a search block reports "More results available", call again with the offset it suggests. Paging is stateless (a skip count only, no cursors).

Filters are FACET SLUGS (jurisdictions: nz | au | gb; practiceAreas: slugs like "tax"; contentTypes: cases | legislation | commentary). Values within an array are OR-combined; fields are AND-combined. Unknown slugs are rejected with a hint, never silently ignored.

JURISDICTION: If the user's question names or clearly implies a jurisdiction (New Zealand → nz, Australia → au, United Kingdom → gb), you MUST set the `jurisdictions` filter to match. Leaving it blank searches ALL jurisdictions and ranks purely by how much content each has, so a New Zealand question can come back full of Australian material. Only leave it blank when the user genuinely wants all jurisdictions, or none is implied.

Returns ranked extracts with a clickable resolver link and identifiers (documentId / chunkId) that read_document can use to fetch more. Each result also carries its documentType facet slug, reusable in future filters.

When citing a source, use ONLY the `link` field from the result. Never construct, guess, or recall a source URL yourself — in particular do not link to austlii.edu.au, nzlii.org, or other external case-law databases. If a result has no link, cite it by title without a URL.

NameTypeDescription
searches
Required
object[]One or more searches to run in parallel (max 5). (min items 1, max items 5)
searches[].contentTypesstring[]Facet filter — the broad collections to search within (OR across values). Leaving blank searches all. Commentary includes government guidance — useful for areas the government informs the public about, e.g. Tax or Employment. (min items 1) Valid values supplied to the assistant at runtime.
searches[].dateFromstringStart of the document published-date range (inclusive), as YYYY-MM-DD. Not applied to legislation.
searches[].dateTostringEnd of the document published-date range (inclusive), as YYYY-MM-DD. Not applied to legislation.
searches[].jurisdictionsstring[]Facet filter — ISO jurisdiction codes (gb is the United Kingdom — never "uk"). Leaving blank searches all jurisdictions ranked by corpus volume, which can bury the jurisdiction the user actually meant — set this whenever the user names a country or results may be dominated by the wrong jurisdiction. (min items 1) Valid values supplied to the assistant at runtime.
searches[].limitintegerHow many results to return for THIS search (1–50). Leave blank to use the server default batch size. (≥ 1, ≤ 50)
searches[].offsetintegerNumber of results to skip for THIS search; default 0 (start from the first result). When a search block reports "More results available", call this tool again with the offset it suggests to fetch further results. Stateless — a skip count only, no cursors. (≥ 0)
searches[].practiceAreasstring[]Facet filter — practice-area SLUGS (e.g. "tax"), jurisdiction-neutral; combine with jurisdictions to target one market. There is complete coverage of NZ and AU, but only tax for the UK. Practice areas may not always be accurate; leave blank to consider documents that may have been categorised incorrectly. (min items 1) Valid values supplied to the assistant at runtime.
searches[].qstringThe query to search for. Keyword mode supports AND, OR, parentheses, and "quoted phrases" (operators must be UPPERCASE). (min length 1, max length 400)
searches[].searchType"keyword" | "semantic"Either keyword or semantic. Leaving blank searches both and fuses the results. Use keyword to find a precise string — e.g. a case citation "[2007] NZSC 82" — or precise combinations — e.g. "(s 34 OR section 34) AND Companies Act 1993". Use semantic to find answers to questions, similar fact patterns, or applications of rules (HyDE).
searches[].searchWithin"titles" | "summaries" | "content"[]Which document SURFACE to search: titles, summaries, and/or content (the actual words). Leaving blank searches all three. Titles are reasonably reliable but not always accurate; summaries describe what a document covers. (min items 1)
searches[].sectionCodestringFor a specific section of legislation: put the Act in `q` and the bare section code here (e.g. "BA 1", "7", "135") — no "s" or "section" prefix. Forces a content search. Legislation only.

jurisdictions, contentTypes and practiceAreas take values from Nylon’s live catalogue. In production, the assistant receives the valid values in the tool definition; the schema on this page leaves them open.

Filter Values Per search
jurisdictions nz, au, gb (use gb for the UK, never uk) Up to 3
contentTypes cases, legislation, commentary (commentary includes government guidance) Up to 3
practiceAreas Slugs such as tax. The assistant receives the full list in the tool definition. New Zealand and Australia have full coverage; the UK has tax only. Up to 20

Values within one filter match any of them; separate filters must all match. Nylon rejects a value outside the list with a message; it never ignores it silently.

One text block. For each search, it contains:

  • a count (N results:), then numbered rows;
  • per row: the title; facets (type, contentType, jurisdiction, subJurisdiction, practiceAreas, date, matchedOn, page, score); for legislation, the section, sectionTitle and any definition; a summary where there is one; the matching extract; a link; and the documentId and chunkId;
  • More results available for this search — call again with offset=N. when there’s another page;
  • any warnings, and a note if the query names a jurisdiction the filter leaves out.

With several searches, each block is labelled Search 1 ("…"): and separated by ---. The tool returns no structured content or output schema.

The link opens the source in Nylon’s viewer, at https://docs.usenylon.com/d/{id}, and needs a Nylon sign-in. Assistants are told to cite only this link.

Arguments
{
"searches": [
{
"q": "compulsory GST registration threshold",
"jurisdictions": ["nz"],
"contentTypes": ["legislation"],
"limit": 3
}
]
}
Result (abridged)
3 results:
1. Goods and Services Tax Act 1985
contentType: legislation | jurisdiction: nz | practiceAreas: tax | score: 0.87
section: 51 | sectionTitle: Persons making supplies in course of taxable activity to be registered
…
link: https://docs.usenylon.com/d/4f0c…
documentId: 9b2e… | chunkId: 4f0c…
2. …
More results available for this search — call again with offset=3.

Assistants call search_library whenever a question could turn on tax or law: legislation, cases, rates, filing rules or “is this allowed?”. The tool description tells them to search rather than answer from memory.

Prompts that work well:

  • “Using Nylon, when must a business register for GST in New Zealand?”
  • “Find Australian cases on whether a company loan to a shareholder was a deemed dividend under Division 7A.”
  • “What HMRC guidance covers the section 455 charge on loans to participators?”

Tips for builders:

  • Set jurisdictions when the question names one. Leaving it blank searches all three, ranked by volume, so an NZ question can come back full of Australian material. Use gb for the UK, never uk.
  • Keyword mode supports AND, OR, parentheses and “quoted phrases”. Operators must be uppercase.
  • Batch related searches: up to 5 run in parallel in one call.
  • Page statelessly: pass the offset the result suggests.
Full JSON schema
tools/list entry
{
"name": "search_library",
"title": "Search the Nylon legal library",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"searches": {
"description": "One or more searches to run in parallel (max 5).",
"items": {
"additionalProperties": false,
"properties": {
"contentTypes": {
"description": "Facet filter — the broad collections to search within (OR across values). Leaving blank searches all. Commentary includes government guidance — useful for areas the government informs the public about, e.g. Tax or Employment.",
"items": {
"minLength": 1,
"type": "string"
},
"minItems": 1,
"type": "array"
},
"dateFrom": {
"description": "Start of the document published-date range (inclusive), as YYYY-MM-DD. Not applied to legislation.",
"type": "string"
},
"dateTo": {
"description": "End of the document published-date range (inclusive), as YYYY-MM-DD. Not applied to legislation.",
"type": "string"
},
"jurisdictions": {
"description": "Facet filter — ISO jurisdiction codes (gb is the United Kingdom — never \"uk\"). Leaving blank searches all jurisdictions ranked by corpus volume, which can bury the jurisdiction the user actually meant — set this whenever the user names a country or results may be dominated by the wrong jurisdiction.",
"items": {
"minLength": 1,
"type": "string"
},
"minItems": 1,
"type": "array"
},
"limit": {
"description": "How many results to return for THIS search (1–50). Leave blank to use the server default batch size.",
"maximum": 50,
"minimum": 1,
"type": "integer"
},
"offset": {
"description": "Number of results to skip for THIS search; default 0 (start from the first result). When a search block reports \"More results available\", call this tool again with the offset it suggests to fetch further results. Stateless — a skip count only, no cursors.",
"minimum": 0,
"type": "integer"
},
"practiceAreas": {
"description": "Facet filter — practice-area SLUGS (e.g. \"tax\"), jurisdiction-neutral; combine with jurisdictions to target one market. There is complete coverage of NZ and AU, but only tax for the UK. Practice areas may not always be accurate; leave blank to consider documents that may have been categorised incorrectly.",
"items": {
"minLength": 1,
"type": "string"
},
"minItems": 1,
"type": "array"
},
"q": {
"description": "The query to search for. Keyword mode supports AND, OR, parentheses, and \"quoted phrases\" (operators must be UPPERCASE).",
"maxLength": 400,
"minLength": 1,
"type": "string"
},
"searchType": {
"description": "Either keyword or semantic. Leaving blank searches both and fuses the results.\nUse keyword to find a precise string — e.g. a case citation \"[2007] NZSC 82\" — or precise combinations — e.g. \"(s 34 OR section 34) AND Companies Act 1993\".\nUse semantic to find answers to questions, similar fact patterns, or applications of rules (HyDE).",
"enum": [
"keyword",
"semantic"
],
"type": "string"
},
"searchWithin": {
"description": "Which document SURFACE to search: titles, summaries, and/or content (the actual words). Leaving blank searches all three. Titles are reasonably reliable but not always accurate; summaries describe what a document covers.",
"items": {
"enum": [
"titles",
"summaries",
"content"
],
"type": "string"
},
"minItems": 1,
"type": "array"
},
"sectionCode": {
"description": "For a specific section of legislation: put the Act in `q` and the bare section code here (e.g. \"BA 1\", \"7\", \"135\") — no \"s\" or \"section\" prefix. Forces a content search. Legislation only.",
"type": "string"
}
},
"type": "object"
},
"maxItems": 5,
"minItems": 1,
"type": "array"
}
},
"required": [
"searches"
],
"type": "object"
},
"annotations": {
"destructiveHint": false,
"openWorldHint": false,
"readOnlyHint": true,
"title": "Search the Nylon legal library"
}
}