Skip to main content
Glama

List Cases

list_cases
Read-only

Retrieve case titles, citations, and IDs from a Canadian caselaw database by specifying the database ID, with optional filters for decision date, publication date, language, and result count.

Instructions

List decisions from a specific caselaw database. Returns case titles, citations, and IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseIdYesDatabase ID from list_case_databases (e.g. "onca", "csc-scc")
decisionDateAfterNoFilter: decision date after (YYYY-MM-DD)
decisionDateBeforeNoFilter: decision date before (YYYY-MM-DD)
languageNoResponse languageen
offsetNoStarting record index
publishedAfterNoFilter: published on CanLII after this date (YYYY-MM-DD)
publishedBeforeNoFilter: published on CanLII before this date (YYYY-MM-DD)
resultCountNoNumber of results to return (max 10000)

Implementation Reference

  • src/server.ts:120-183 (registration)
    The tool 'list_cases' is registered using server.registerTool() with inputSchema (databaseId, decisionDateAfter/Before, language, offset, publishedAfter/Before, resultCount) and an async handler.
    // 2. List cases
    server.registerTool(
    	"list_cases",
    	{
    		annotations: { readOnlyHint: true },
    		description:
    			"List decisions from a specific caselaw database. Returns case titles, citations, and IDs.",
    		inputSchema: {
    			databaseId: z
    				.string()
    				.describe('Database ID from list_case_databases (e.g. "onca", "csc-scc")'),
    			decisionDateAfter: z
    				.string()
    				.optional()
    				.describe("Filter: decision date after (YYYY-MM-DD)"),
    			decisionDateBefore: z
    				.string()
    				.optional()
    				.describe("Filter: decision date before (YYYY-MM-DD)"),
    			language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    			offset: z.number().int().min(0).default(0).describe("Starting record index"),
    			publishedAfter: z
    				.string()
    				.optional()
    				.describe("Filter: published on CanLII after this date (YYYY-MM-DD)"),
    			publishedBefore: z
    				.string()
    				.optional()
    				.describe("Filter: published on CanLII before this date (YYYY-MM-DD)"),
    			resultCount: z
    				.number()
    				.int()
    				.min(1)
    				.max(10000)
    				.default(25)
    				.describe("Number of results to return (max 10000)"),
    		},
    		title: "List Cases",
    	},
    	async ({
    		language,
    		databaseId,
    		offset,
    		resultCount,
    		publishedBefore,
    		publishedAfter,
    		decisionDateBefore,
    		decisionDateAfter,
    	}) => {
    		try {
    			const params: Record<string, string> = {
    				offset: String(offset),
    				resultCount: String(resultCount),
    			};
    			if (publishedBefore) params.publishedBefore = publishedBefore;
    			if (publishedAfter) params.publishedAfter = publishedAfter;
    			if (decisionDateBefore) params.decisionDateBefore = decisionDateBefore;
    			if (decisionDateAfter) params.decisionDateAfter = decisionDateAfter;
    			return ok(await request(`/caseBrowse/${language}/${databaseId}/`, params));
    		} catch (e) {
    			return err(String(e));
    		}
    	},
    );
  • The handler function for 'list_cases': builds query params from the inputs and calls the CanLII API endpoint /caseBrowse/{language}/{databaseId}/, returning results as JSON.
    async ({
    	language,
    	databaseId,
    	offset,
    	resultCount,
    	publishedBefore,
    	publishedAfter,
    	decisionDateBefore,
    	decisionDateAfter,
    }) => {
    	try {
    		const params: Record<string, string> = {
    			offset: String(offset),
    			resultCount: String(resultCount),
    		};
    		if (publishedBefore) params.publishedBefore = publishedBefore;
    		if (publishedAfter) params.publishedAfter = publishedAfter;
    		if (decisionDateBefore) params.decisionDateBefore = decisionDateBefore;
    		if (decisionDateAfter) params.decisionDateAfter = decisionDateAfter;
    		return ok(await request(`/caseBrowse/${language}/${databaseId}/`, params));
    	} catch (e) {
    		return err(String(e));
    	}
    },
  • Input schema for 'list_cases' defining six optional filter parameters and two required ones (databaseId, language) with Zod validation.
    inputSchema: {
    	databaseId: z
    		.string()
    		.describe('Database ID from list_case_databases (e.g. "onca", "csc-scc")'),
    	decisionDateAfter: z
    		.string()
    		.optional()
    		.describe("Filter: decision date after (YYYY-MM-DD)"),
    	decisionDateBefore: z
    		.string()
    		.optional()
    		.describe("Filter: decision date before (YYYY-MM-DD)"),
    	language: z.enum(["en", "fr"]).default("en").describe("Response language"),
    	offset: z.number().int().min(0).default(0).describe("Starting record index"),
    	publishedAfter: z
    		.string()
    		.optional()
    		.describe("Filter: published on CanLII after this date (YYYY-MM-DD)"),
    	publishedBefore: z
    		.string()
    		.optional()
    		.describe("Filter: published on CanLII before this date (YYYY-MM-DD)"),
    	resultCount: z
    		.number()
    		.int()
    		.min(1)
    		.max(10000)
    		.default(25)
    		.describe("Number of results to return (max 10000)"),
    },
  • The 'request' helper closure (bound to apiKey) used by the handler to make API calls.
    const request = (path: string, params?: Record<string, string>) =>
    	canliiRequest(apiKey, path, params);
Behavior4/5

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

Annotations already declare readOnlyHint=true, so agent knows it's safe. The description adds that it returns case titles, citations, and IDs. However, it does not disclose pagination behavior, default results, or date filtering specifics, which would be helpful beyond the schema.

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 very concise (two sentences) and front-loaded with the action. It is efficient but could be better structured (e.g., listing parameters or example).

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?

Given no output schema, the description adequately states return values. However, it omits defaults (e.g., resultCount defaults to 25) and pagination details. For a list tool with 8 parameters, it is mostly complete.

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?

Schema description coverage is 100%, so parameters are well-documented structurally. The description adds no additional semantic meaning beyond what the schema provides, earning a baseline score of 3.

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 it lists decisions from a specific caselaw database and explicitly mentions the returned fields (titles, citations, IDs). It distinguishes from siblings like get_case (single case) and list_case_databases (lists databases).

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

Usage Guidelines3/5

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

The description implies use with a specific databaseId but does not explicitly state when to use this tool versus alternatives like get_case or provide any exclusions or context for choosing this tool.

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