Skip to main content
Glama

get_case_citator

Retrieve citation relationships for a case to verify its legal authority. See which later cases cite it, which authorities it relied on, and which statutes it references. Critical for determining if a case remains good law.

Instructions

Look up citation relationships for a case. Critical for verifying if a case is still good law. Use 'citingCases' to see what later cases cite this decision — if many recent cases cite it approvingly, it is strong authority. Use 'citedCases' to see what authorities this case relied on. Use 'citedLegislations' to see what statutes the case references. Returns the full list of citing/cited items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoLanguage: 'en' for English (default), 'fr' for Frenchen
databaseIdYesCourt database ID (e.g., 'onsc', 'onca', 'csc-scc')
caseIdYesCase unique identifier (e.g., '2021onsc8582')
metadataTypeYes'citingCases' = what later cases cite this one (check if still good law); 'citedCases' = what this case relies on; 'citedLegislations' = statutes referenced
publishedBeforeNoDate first published on CanLII (YYYY-MM-DD)
publishedAfterNoDate first published on CanLII (YYYY-MM-DD)
modifiedBeforeNoDate content last modified on CanLII (YYYY-MM-DD)
modifiedAfterNoDate content last modified on CanLII (YYYY-MM-DD)
changedBeforeNoDate metadata or content last changed on CanLII (YYYY-MM-DD)
changedAfterNoDate metadata or content last changed on CanLII (YYYY-MM-DD)
decisionDateBeforeNoDecision date upper bound (YYYY-MM-DD)
decisionDateAfterNoDecision date lower bound (YYYY-MM-DD)

Implementation Reference

  • The main handler for the get_case_citator tool. It registers an MCP tool that accepts language, databaseId, caseId, metadataType, and optional date parameters, then fetches citation data from the CanLII API at /v1/caseCitator/{language}/{databaseId}/{caseId}/{metadataType}. It parses the response using the appropriate schema (CitedCasesResponseSchema, CitingCasesResponseSchema, or CitedLegislationsResponseSchema) based on the metadataType and returns the result.
    // TOOL: get_case_citator
    // ============================================================
    server.tool(
    	"get_case_citator",
    	"Look up citation relationships for a case. Critical for verifying if a case is still good law. " +
    	"Use 'citingCases' to see what later cases cite this decision — if many recent cases cite it approvingly, it is strong authority. " +
    	"Use 'citedCases' to see what authorities this case relied on. " +
    	"Use 'citedLegislations' to see what statutes the case references. " +
    	"Returns the full list of citing/cited items.",
    	{
    		language: z.enum(["en", "fr"]).default("en")
    			.describe("Language: 'en' for English (default), 'fr' for French"),
    		databaseId: pathSegmentSchema
    			.describe("Court database ID (e.g., 'onsc', 'onca', 'csc-scc')"),
    		caseId: pathSegmentSchema
    			.describe("Case unique identifier (e.g., '2021onsc8582')"),
    		metadataType: z.enum(["citedCases", "citingCases", "citedLegislations"])
    			.describe("'citingCases' = what later cases cite this one (check if still good law); 'citedCases' = what this case relies on; 'citedLegislations' = statutes referenced"),
    		...dateParametersSchema,
    	},
    	async (params) => {
    		try {
    			const { language, databaseId, caseId, metadataType, ...dateParams } = params;
    			const urlParams = new URLSearchParams({ api_key: apiKey });
    			buildDateParams(urlParams, dateParams);
    
    			const response = await apiFetch(
    				`https://api.canlii.org/v1/caseCitator/${language}/${encodeURIComponent(databaseId)}/${encodeURIComponent(caseId)}/${metadataType}?${urlParams.toString()}`
    			);
    
    			if (!response.ok) {
    				return errorResponse(`Error: Failed to fetch case citator data (${response.status})`);
    			}
    
    			const data = await response.json();
    
    			const schemaMap = {
    				citedCases: CitedCasesResponseSchema,
    				citingCases: CitingCasesResponseSchema,
    				citedLegislations: CitedLegislationsResponseSchema,
    			} as const;
    
    			const parsed = schemaMap[metadataType].parse(data);
    			return jsonResponse(parsed);
    		} catch (error) {
    			return errorResponse(
    				`Error: ${error instanceof Error ? error.message : "Unknown error"}`
    			);
    		}
    	}
    );
  • Zod schema for CitedCasesResponse — validates the response when metadataType is 'citedCases', expects an object with an array of CaseSchema under the 'citedCases' key.
    export const CitedCasesResponseSchema = z.object({
        citedCases: z.array(CaseSchema),
    }).passthrough();
  • Zod schema for CitingCasesResponse — validates the response when metadataType is 'citingCases', expects an object with an array of CaseSchema under the 'citingCases' key.
    export const CitingCasesResponseSchema = z.object({
        citingCases: z.array(CaseSchema),
    }).passthrough();
  • Zod schema for CitedLegislationsResponse — validates the response when metadataType is 'citedLegislations', expects an object with an array of LegislationItemSchema under the 'citedLegislations' key.
    export const CitedLegislationsResponseSchema = z.object({
        citedLegislations: z.array(LegislationItemSchema),
    }).passthrough();
  • src/index.ts:299-316 (registration)
    Tool registration for get_case_citator via server.tool(), defining the tool name, description, and input schema including language, databaseId, caseId, metadataType, and date parameters.
    server.tool(
    	"get_case_citator",
    	"Look up citation relationships for a case. Critical for verifying if a case is still good law. " +
    	"Use 'citingCases' to see what later cases cite this decision — if many recent cases cite it approvingly, it is strong authority. " +
    	"Use 'citedCases' to see what authorities this case relied on. " +
    	"Use 'citedLegislations' to see what statutes the case references. " +
    	"Returns the full list of citing/cited items.",
    	{
    		language: z.enum(["en", "fr"]).default("en")
    			.describe("Language: 'en' for English (default), 'fr' for French"),
    		databaseId: pathSegmentSchema
    			.describe("Court database ID (e.g., 'onsc', 'onca', 'csc-scc')"),
    		caseId: pathSegmentSchema
    			.describe("Case unique identifier (e.g., '2021onsc8582')"),
    		metadataType: z.enum(["citedCases", "citingCases", "citedLegislations"])
    			.describe("'citingCases' = what later cases cite this one (check if still good law); 'citedCases' = what this case relies on; 'citedLegislations' = statutes referenced"),
    		...dateParametersSchema,
    	},
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It states 'Returns the full list of citing/cited items,' which implies a complete list without pagination. However, it does not cover potential limits, error handling, authentication needs, or response structure. For a read-only lookup tool, this is adequate but lacks depth.

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 paragraph of four sentences, front-loaded with the core purpose. Every sentence provides useful information without unnecessary words. It is highly concise and well-structured for quick comprehension.

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 the tool has 12 parameters (mostly optional date filters) and no output schema, the description focuses on the essential use cases and the returned item list. It covers the critical metadataType options and the tool's importance. However, it does not mention the filtering capabilities or language parameter, which are documented in the schema but not in the description. Overall, it is sufficiently complete for an AI agent to understand the tool's core functionality.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage, providing clear meaning for all parameters. The description adds value by explaining the semantic intent of metadataType and the overall workflow, e.g., 'use 'citingCases' to see what later cases cite this decision.' It does not repeat parameter descriptions but enhances understanding, going beyond the baseline 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 the tool's purpose: 'Look up citation relationships for a case.' It specifies the three metadataType values and their meanings (citingCases, citedCases, citedLegislations), making the tool's function very specific and distinguishable from siblings like get_case_citator_tease, though not explicitly differentiating.

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

Usage Guidelines4/5

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

The description provides clear guidance on when to use each metadataType: 'Use 'citingCases' to see what later cases cite this decision... Use 'citedCases' to see what authorities this case relied on. Use 'citedLegislations' to see what statutes the case references.' It frames the tool as 'critical for verifying if a case is still good law,' but does not mention when not to use it or how it compares to the sibling get_case_citator_tease.

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/mohammadfarooqi/canlii-mcp'

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