Skip to main content
Glama

List Case Databases

list_case_databases
Read-only

Retrieve a list of all courts and tribunals in the CanLII collection along with their database IDs. Filter results by language (English or French) to identify available jurisdictions.

Instructions

List all courts and tribunals in the CanLII collection with their database IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoResponse languageen

Implementation Reference

  • The handler function for the 'list_case_databases' tool. It calls the CanLII API endpoint /caseBrowse/{language}/ and returns the JSON result, or an error message on failure.
    async ({ language }) => {
    	try {
    		return ok(await request(`/caseBrowse/${language}/`));
    	} catch (e) {
    		return err(String(e));
    	}
    },
  • Input schema for the tool: takes an optional 'language' parameter (enum: 'en' or 'fr') defaulting to 'en'.
    inputSchema: {
    	language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    },
    title: "List Case Databases",
  • src/server.ts:99-118 (registration)
    Registration of the 'list_case_databases' tool via server.registerTool() with annotations, description, title, input schema, and handler.
    // 1. List case databases
    server.registerTool(
    	"list_case_databases",
    	{
    		annotations: { readOnlyHint: true },
    		description:
    			"List all courts and tribunals in the CanLII collection with their database IDs.",
    		inputSchema: {
    			language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    		},
    		title: "List Case Databases",
    	},
    	async ({ language }) => {
    		try {
    			return ok(await request(`/caseBrowse/${language}/`));
    		} catch (e) {
    			return err(String(e));
    		}
    	},
    );
  • The canliiRequest helper function that performs the actual HTTP call to the CanLII API with rate limiting. Used by the handler to call /caseBrowse/{language}/.
    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();
    	}
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the descriptive burden is lower. The description adds that it lists all items, which implies a full list without filtering. However, it does not disclose whether the list is paginated, sorted, or if there are any limits. A score of 3 is appropriate given the safety annotations.

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?

The description is a single sentence with no redundant words. It conveys the essential information efficiently.

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?

For a simple list tool with no output schema and one parameter, the description covers the main purpose. It could mention that the output is a list of database IDs and names, but that might be inferred. No critical gaps.

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?

There is only one parameter (language) with full schema coverage (100%). The description does not add any extra meaning beyond the schema's description and enum values. Baseline score of 3 is correct.

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

Purpose5/5

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

The description clearly states the tool lists all courts and tribunals with their database IDs, which is a specific verb-resource combination. It distinguishes from siblings like list_cases and list_legislation_databases by focusing on court/tribunal 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 on when to use this tool versus alternatives. For example, it does not mention that this is a metadata listing tool, not for searching or retrieving case content. The agent has to infer from the name.

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