Skip to main content
Glama

List Legislation Databases

list_legislation_databases
Read-only

Retrieve a complete list of legislation and regulation databases indexed in the CanLII legal database. Specify language for English or French output.

Instructions

List all legislation and regulation databases in the CanLII collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoResponse languageen

Implementation Reference

  • src/server.ts:237-255 (registration)
    Registration of the 'list_legislation_databases' tool via server.registerTool(), including its input schema (language parameter) and the handler that calls the CanLII API endpoint /legislationBrowse/{language}/.
    // 5. List legislation databases
    server.registerTool(
    	"list_legislation_databases",
    	{
    		annotations: { readOnlyHint: true },
    		description: "List all legislation and regulation databases in the CanLII collection.",
    		inputSchema: {
    			language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    		},
    		title: "List Legislation Databases",
    	},
    	async ({ language }) => {
    		try {
    			return ok(await request(`/legislationBrowse/${language}/`));
    		} catch (e) {
    			return err(String(e));
    		}
    	},
    );
  • The handler function for 'list_legislation_databases'. It takes a 'language' parameter, calls request(`/legislationBrowse/${language}/`), and returns the result.
    async ({ language }) => {
    	try {
    		return ok(await request(`/legislationBrowse/${language}/`));
    	} catch (e) {
    		return err(String(e));
    	}
    },
  • Input schema for the tool: a 'language' enum (en/fr) with default 'en', described as 'Response language'.
    inputSchema: {
    	language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    },
  • The 'request' helper closure that wraps canliiRequest with the API key, used by the handler to make the HTTP call.
    const request = (path: string, params?: Record<string, string>) =>
    	canliiRequest(apiKey, path, params);
  • The core HTTP helper 'canliiRequest' that performs the actual fetch to the CanLII API with rate limiting and error handling.
    async function canliiRequest(
    	apiKey: string,
    	path: string,
    	params: Record<string, string> = {},
    ): Promise<unknown> {
    	await acquireSlot();
    	try {
    		const url = new URL(`${BASE_URL}${path}`);
    		url.searchParams.set("api_key", apiKey);
    		for (const [k, v] of Object.entries(params)) {
    			if (v !== undefined && v !== "") url.searchParams.set(k, v);
    		}
    		const res = await fetch(url.toString());
    		if (!res.ok) {
    			const body = await res.text();
    			throw new Error(`CanLII API ${res.status}: ${body}`);
    		}
    		return await res.json();
    	} finally {
    		releaseSlot();
    	}
    }
Behavior4/5

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

The description aligns with the readOnlyHint annotation, indicating a safe read operation. No additional behavioral traits are disclosed, but since the annotation already covers it, the description is adequate.

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?

The description is a single sentence with no wasted words. It is concise, though it could benefit from more detail about the output or usage context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, the description does not explain what the response contains (e.g., names, IDs). It is minimally complete but could be improved.

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?

The input schema has 100% description coverage for the single parameter, so the description adds no extra semantic value. Baseline 3 is appropriate.

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?

The description clearly states it lists all legislation and regulation databases, using a specific verb and resource. However, it does not differentiate from the sibling tool 'list_legislation', which might also list legislation-related items, though likely documents rather than databases.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like list_case_databases or list_legislation. The description does not mention any context or exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vaquill-AI/canlii-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server