List Legislation
list_legislationRetrieve a list of statutes or regulations from a specified Canadian legislation database by providing the database ID (e.g., 'ons' for Ontario statutes).
Instructions
List statutes or regulations from a specific legislation database.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| databaseId | Yes | Legislation database ID from list_legislation_databases (e.g. "ons" for Ontario statutes) | |
| language | No | Response language | en |
Implementation Reference
- src/server.ts:273-279 (handler)The handler function for the 'list_legislation' tool. It calls the CanLII API endpoint `/legislationBrowse/${language}/${databaseId}/` and returns the result.
async ({ language, databaseId }) => { try { return ok(await request(`/legislationBrowse/${language}/${databaseId}/`)); } catch (e) { return err(String(e)); } }, - src/server.ts:262-271 (schema)The input schema for 'list_legislation': requires a databaseId string and optional language (en/fr, default en).
description: "List statutes or regulations from a specific legislation database.", inputSchema: { databaseId: z .string() .describe( 'Legislation database ID from list_legislation_databases (e.g. "ons" for Ontario statutes)', ), language: z.enum(["en", "fr"]).default("en").describe("Response language"), }, title: "List Legislation", - src/server.ts:258-280 (registration)Registration of the 'list_legislation' tool via server.registerTool() with its schema and handler.
server.registerTool( "list_legislation", { annotations: { readOnlyHint: true }, description: "List statutes or regulations from a specific legislation database.", inputSchema: { databaseId: z .string() .describe( 'Legislation database ID from list_legislation_databases (e.g. "ons" for Ontario statutes)', ), language: z.enum(["en", "fr"]).default("en").describe("Response language"), }, title: "List Legislation", }, async ({ language, databaseId }) => { try { return ok(await request(`/legislationBrowse/${language}/${databaseId}/`)); } catch (e) { return err(String(e)); } }, );