> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getclean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> getclean's own MCP server is at https://mcp.getclean.ai/mcp. The /mcp path of this docs site is Mintlify's search over these pages, not getclean.
> Every answer of the API opens with outcome. A page that could not be read is a record whose outcome says why, never an HTTP error; read outcome before anything else.
> The API's contract is the OpenAPI 3.1 file at https://docs.getclean.ai/openapi.yaml; the SDKs are generated from it.
> The product's name is written getclean, in lower case.

# Case citations checked before filing

> Before a brief is filed, look up every case it cites by its docket number or its reporter citation, and match every quotation against the opinion. A citation to a case that does not exist is found by your agent, not by the court.

A brief cites 14 cases. One of them does not exist: a model wrote a plausible name, a plausible court, and a plausible quotation. The clerk of the court looks it up, and the firm is sanctioned. Every cited case can be looked up before the brief is filed, and every quotation matched against the opinion it is said to come from. This page builds that check.

## The run in 4 steps

### Read the courts from the catalog

A docket number means nothing without its court. The catalog of datasources lists, for each legal datasource, the courts whose dockets it can look up, each with a code. Your agent reads the codes from there and does not guess one.

### Look up every citation in one call

Each citation is one search by identifier, with no words at all. A batch runs 20 of them. This request looks up 3 citations of a brief, each by the kind of code it has, and fetches the opinion that is found.

```json Request body of search_batch, cut to 3 of 14 items theme={"theme":"css-variables"}
{
  "items": [
    {
      "label": "footnote-4",
      "subject_identifiers": [{"scheme": "reporter_citation", "value": "REPORTER_CITATION"}]
    },
    {
      "label": "footnote-7",
      "subject_identifiers": [{"scheme": "docket", "value": "DOCKET_NUMBER", "issuer": "nysd"}]
    },
    {
      "label": "footnote-12",
      "subject_identifiers": [{"scheme": "ecli", "value": "ECLI_CODE"}]
    }
  ],
  "datasources": ["legal"],
  "contents": { "top": 1, "max_characters": 0},
  "deterministic_only": true
}
```

Replace `REPORTER_CITATION`, `DOCKET_NUMBER`, and `ECLI_CODE` with the codes as the brief cites them. The labels are the footnotes of the brief, so each result finds its way back to its place.

With `deterministic_only` set to `true`, no model ranks anything. A code is in a register or it is not.

### Read which citations were not found

The response starts with a tally. Each search that found the case has one result, which says which of your codes it matches, and a record of the opinion. A search that found nothing has the outcome reason `none`.

A citation with `none` goes to a lawyer at once. It is not proof that the case does not exist: it says that the datasources named in the response do not have it. That moment is the right one to find out, and the brief says so before a judge does.

### Match every quotation

For each case that was found, send the quotations that the brief attributes to it against the record of the opinion.

```json Request body of highlight_contents theme={"theme":"css-variables"}
{
  "highlights": ["FIRST_QUOTATION", "SECOND_QUOTATION"],
  "deterministic_only": true,
  "max_characters": 0
}
```

Replace the 2 placeholders with the quotations as the brief has them.

A quotation that is in the opinion comes back as `exact`, with its place in the opinion. It comes back as `near` if it differs only in upper and lower case, in the punctuation at the ends of words, or by an ellipsis. A quotation with the notice `highlight_not_found` is not in that opinion as written. This check uses no model and costs nothing.

A string is matched inside one block, which is one paragraph of the opinion. Send a quotation that runs over 2 paragraphs as 2 strings.

## What the partner can check

| The partner asks | What the check has |
| - | - |
| Does every case exist? | For each footnote, the result that matches its code, or the reason `none`. |
| Where was it looked up? | The datasources of each search, by name. |
| Is every quotation real? | For each quotation, its place in the opinion, or a notice that it is not there. |
| Was a model involved? | No, because every step of this check is a match of codes and of words. |

## Know the limits

A lookup says that a case is in a register. It does not say whether the case is still good law, and no datasource result should be read as that. A result has what the datasource states about the item, such as its status, where the datasource states one.

The page of a reporter inside an opinion, which a pin cite needs, is in the text of the opinion for your agent to read. A place in a record is its section, its block, and its words.

Coverage differs by country and by court. The catalog says what each datasource covers, and a court that no datasource covers comes back as a gap, not as a missing case.

For the calls, see [Find the exact paper, case, or company by its identifier](https://docs.getclean.ai/find/identifiers.md) and [Check every sentence of a draft against its source](https://docs.getclean.ai/read/check-a-draft.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.