Skip to main content
Glama

Get court decision statistics

get_case_statistics
Read-onlyIdempotent

Get aggregated case statistics.

    Returns case counts grouped by time period, optionally filtered
    by court, state, or jurisdiction.

    Without ``date_after`` only the **last 12 months** are counted.
    For counts over a longer period ("per year since 2018"), pass
    ``date_after`` (e.g. "2018-01-01") together with ``group_by="year"``.
    The response's ``date_range`` shows the period that was counted.

    Args:
        court_id: Filter by court ID.
        state: Filter by state name or slug.
        jurisdiction: Filter by jurisdiction. Accepts the English
            shortcuts ("ordinary", "labor", …) or the stored German
            values ("Ordentliche Gerichtsbarkeit", …).
        date_after: Count cases from this date (YYYY-MM-DD, default:
            365 days ago).
        date_before: Count cases up to this date (YYYY-MM-DD, default: today).
        group_by: Time grouping: "month" (default) or "year".

    Returns an ``{"error": ...}`` payload (instead of silently zero
    results) when an unknown court_id, state, jurisdiction, group_by,
    or malformed date is supplied — the previous behavior swallowed
    bad inputs as ``total: 0`` and was the dangerous failure mode
    called out in the MCP audit.
    

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_case_statistics"
  }
}

Input Schema

NameRequiredDescriptionDefault
stateNo
court_idNo
group_byNomonth
date_afterNo
date_beforeNo
jurisdictionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the default counting window, how date_range in the response reflects the counted period, and that invalid inputs return an error payload instead of silent zero counts. Those are meaningful behavioral traits for an agent invoking the tool.

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 purpose and the important default-date rule are front-loaded, and the Args section is easy to scan. The closing paragraph is slightly bloated by the historical note about previous behavior and the MCP audit, which does not help an agent decide how to call the tool.

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 read-only count tool with six optional parameters and no output schema, the description covers defaults, filter semantics, grouping, and error behavior well. It could go further by sketching the shape of the successful result beyond date_range, such as how grouped counts are returned.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does so: it explains each of the six parameters, gives defaults, specifies date format YYYY-MM-DD, lists group_by values, and clarifies that jurisdiction accepts either English shortcuts or stored German values.

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 definition opens with a specific verb and resource: 'Get aggregated case statistics,' then immediately narrows scope to 'case counts grouped by time period' with optional filters. That makes it clearly distinguishable from case-level siblings such as get_case or search_cases without requiring schema inspection.

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 gives concrete usage guidance: without date_after only the last 12 months are counted, and for longer periods the caller should pass date_after together with group_by='year'. It does not name an alternative sibling tool or explicitly state when not to use this one, which keeps it short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.