# CNJ (Datajud API Pública) MCP for AI Agents AI Agent Connect

> CNJ (Datajud API Pública) MCP gives your AI agent direct access to Brazil's national judicial database. Use it to query lawsuit statuses, procedural history, and court movements across the entire country. It lets you pull official data from various courts like TRFs, TJs, and the TST without manually navigating government portals.

## Overview
- **Category:** data-management
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_aUA43ZGXwIeUcu4xQJ3UprlIzZu7awEnioPwYGgR/ai-agent-connect
- **Tags:** judicial-records, brazil-law, procedural-data, public-records, legal-tech, api-integration

## Description

Imagine you're a legal analyst trying to track a specific lawsuit's progress across different Brazilian courts. Instead of opening dozens of browser tabs and hunting for the right portal, you can just ask your AI agent to do the heavy lifting. This Connector connects your agent directly to the official CNJ Datajud Public API, making it possible to pull real-time metadata on court movements and procedural history. Whether you're looking for a single case by its CNJ number or trying to filter thousands of records by a specific procedural class, the data comes straight to you. It's a massive time saver for anyone who needs to move away from manual data entry and toward automated legal research. You can find this and thousands of other tools in the Vinkius catalog to build out your full research stack. It handles the complex queries behind the scenes so you can focus on interpreting the results rather than hunting for them.

## Tools

### search_processes_advanced
Run complex filters on judicial records to find specific cases by date or party. This lets you handle large-scale data mining without manual sorting.

### search_processes_by_class_and_organ
Pull lists of lawsuits based on their procedural class and court organ codes. This makes it easy to group cases by legal category or location.

### search_process_by_number
Get the full details of a specific lawsuit by entering its unique CNJ number. You can quickly check the status of a single case without searching through lists.

## Prompt Examples

**Prompt:** 
```
Check the status of process 50012345620234036100 in the TRF3 public API.
```

**Response:** 
```
### Case Status: TRF3

| Detail | Information |
| :--- | :--- |
| **Status** | Active |
| **Class** | Procedural |
| **Court** | 1st Federal Court of São Paulo |
| **Last Movement** | Conclusion for Sentence |
| **Date** | October 12th |

I've confirmed the case is currently with the judge for sentencing.
```

**Prompt:** 
```
List 5 processes from TJDFT with class code 1116 and organ code 12345.
```

**Response:** 
```
I've retrieved 5 processes from TJDFT matching those criteria:

* **Process 1**: Tax Execution - Pending Review
* **Process 2**: Tax Execution - In Progress
* **Process 3**: Tax Execution - Scheduled
* **Process 4**: Tax Execution - Filed
* **Process 5**: Tax Execution - Review

Would you like the specific movement history for any of these?
```

**Prompt:** 
```
Run an advanced search in TST for processes moved in the last 7 days.
```

**Response:** 
```
I found **12 processes** with movements in the last week. 

**Summary:**
* **Labor Appeals**: 8 processes
* **Civil Matters**: 4 processes

I can provide a full list of the process numbers and the specific movement descriptions if you'd like to see them.
```

## Capabilities

### Query specific lawsuits by CNJ number
Get full details for a single lawsuit using its unique national identification number.

### Filter by procedural class and organ
Group and find court records based on specific legal categories and court organ codes.

### Run advanced metadata filters
Execute complex searches using dates, parties, and other metadata fields to find specific records.

### Access multi-court data
Pull information from various Brazilian courts including TRFs, TJs, and the TST.

### Track procedural history
See the chronological movements and status updates for specific judicial processes.

## Use Cases

### Checking a single case status
A lawyer needs to know if a specific case in the TRF3 has moved in the last 48 hours. The agent uses search_process_by_number to check the TRF3 alias.

### Filtering by legal category
A compliance team needs to find all Tax Execution cases in a specific region. The agent runs search_processes_by_class_and_organ to pull the list.

### Large scale data mining
A researcher wants to see all lawsuits involving a specific party from the last year. The agent uses search_processes_advanced to filter by date and party name.

### Monitoring court filings
A firm wants to monitor all new filings in a specific court organ. The agent pulls the latest data using search_processes_by_class_and_organ and summarizes it.

## Benefits

- Stop navigating multiple government portals by using search_process_by_number to get exact lawsuit details instantly.
- Run complex, multi-parameter filters on thousands of records using search_processes_advanced instead of manual searching.
- Categorize large batches of legal data by specific court organs using search_processes_by_class_and_organ.
- Get real-time updates on court movements to keep your clients informed without manual check-ins.
- Automate legal risk assessments by pulling official metadata into your own internal systems.

## How It Works

The bottom line is you get direct, automated access to official Brazilian judicial data without leaving your chat interface.

1. Subscribe to the CNJ (Datajud API Pública) MCP and get your API key from the official CNJ portal.
2. Add your API key to your AI client's configuration settings.
3. Ask your agent to pull specific lawsuit data or run complex filters on judicial records.

## Frequently Asked Questions

**Can the CNJ (Datajud API Pública) MCP find lawsuits in different states?**
Yes, it covers various courts including TRFs, TJs, and the TST across Brazil.

**How does the CNJ (Datajud API Pública) MCP handle specific court numbers?**
You just provide the CNJ number and the court alias, and it pulls the full details for that specific lawsuit.

**Can I use the CNJ (Datajud API Pública) MCP for compliance checks?**
Yes, it's great for identifying legal risks by pulling official metadata and procedural history directly from the source.

**Is the data from the CNJ (Datajud API Pública) MCP official?**
Yes, it pulls directly from the official national database maintained by the National Council of Justice.

**Can the CNJ (Datajud API Pública) MCP filter by specific court organs?**
Yes, you can use specific codes to narrow down results to a specific court organ or procedural class.

**How do I find a process if I only have the CNJ number?**
Use the `search_process_by_number` tool. You will need the unformatted digits of the process and the specific court alias (e.g., `api_publica_tjsp` for São Paulo State Court).

**Can I list multiple processes from a specific court organ?**
Yes, use `search_processes_by_class_and_organ`. Provide the court alias, the procedural class code, and the organ code. You can also control the result size and use pagination.

**What is the 'Advanced Search' tool for?**
The `search_processes_advanced` tool allows you to send a raw Elasticsearch query body. This is useful for complex filtering that isn't covered by standard search tools, such as filtering by specific dates or nested metadata.