Skip to main content
Glama

Search cases by filters

search_cases
Read-onlyIdempotent

Find public court cases in Brazil by court, TPU class or subject codes, court unit, or filing date range. Returns case summaries without movements; at least one filter is required.

Instructions

Search one court's public cases by procedural class, subject, court unit and/or filing date range. Class and subject use numeric codes from CNJ's Unified Procedural Tables (TPU); className does a text match instead. Returns case covers without movements. At least one filter is required. Paginate with nextCursor. Expect 20-60 s latency.

Input Schema

NameRequiredDescriptionDefault
sizeNo
courtYesDataJud court alias, e.g. 'tjsp', 'trf1', 'trt2', 'tre-sp', 'stj'. Optional when looking up a case number: the origin court is derived from the number. Pass it explicitly to read the record held by a higher court (e.g. 'stj'), since appeals keep the origin case number.
cursorNo`nextCursor` from a previous call
filedToNoFiled on or before (YYYY-MM-DD)
classCodeNoTPU class code, e.g. 1116
classNameNoWords in the class name, e.g. 'Execução Fiscal'
filedFromNoFiled on or after (YYYY-MM-DD)
subjectCodesNoTPU subject codes; matches cases with any of them
courtUnitCodeNoCourt unit (órgão julgador) code

Output Schema

NameRequiredDescriptionDefault
courtYes
totalYes
resultsYes
nextCursorYesPass as `cursor` to fetch the next page

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new operational context: 'Expect 20-60 s latency', cursor-based pagination via `nextCursor`, and that responses contain case covers without movements. Latency and pagination are the kind of details structured hints cannot express.

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?

Five short sentences, each carrying distinct load: scope, coding scheme, return shape, constraint, pagination, latency. The most decision-critical facts (single court, at least one filter) appear early.

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

Completeness5/5

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

With an output schema present, return values need not be described, and the description still flags the covers-only shape. For a 9-parameter, 60+ enum-value search tool, latency, pagination, filter requirement, and code-system distinctions cover everything an agent needs before calling.

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?

Schema coverage is 89% so the baseline is 3, but the description earns more by explaining that class and subject are TPU numeric codes while `className` is a text match, and that `nextCursor` feeds `cursor`. It does not elaborate on `size`, `courtUnitCode`, or date-range interaction with the court scoping.

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?

States a specific verb (search) and resource (public cases) scoped to a single court, and enumerates the filter dimensions: procedural class, subject, court unit, filing date range. The phrase 'Returns case covers without movements' also separates it from the sibling list_movements tool.

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?

Gives a hard precondition ('At least one filter is required') and clarifies the classCode/className choice ('numeric codes from TPU; `className` does a text match instead'), which is real routing guidance between parameters. It does not explicitly say when to prefer get_case over this search, so it stops short of full when/when-not coverage.

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

Deploy Server

Other Tools