# Inep Dados Abertos MCP

> Inep Dados Abertos connects your AI client directly to Brazil’s official educational data portal. You can query massive datasets like Censo Escolar, ENEM results, and IDEB statistics using natural language or SQL-like queries; no manual downloading required. This MCP lets you find specific microdata points across multiple years and map organizational structures within the Brazilian Ministry of Education.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** education-data, brazil, academic-research, statistics, open-data, census

## Description

This connector gives your agent direct access to some of Brazil's most detailed educational data. Forget spending hours navigating complex government websites or wrestling with huge, raw CSV files. Instead, you ask for exactly what you need—say, 'What was the average exam score in São Paulo for public schools in 2018?'—and get a targeted answer. The system handles the deep dive into millions of records across various academic packages and resources. It’s all managed through Vinkius; you just connect your preferred AI client and start asking questions. You can search, inspect metadata, or run specific queries to pull out exactly the data points you need for any kind of reporting or research.

## Tools

### get_group
Retrieves full details about a specific group within the INEP structure.

### get_organization
Gets detailed information for any registered department or body in INEP.

### get_package
Fetches metadata and details about a specific educational dataset package.

### get_resource
Retrieves structural information for an individual data file or resource within a package.

### list_groups
Lists all available groups defined within the INEP catalog.

### list_organizations
Provides a list of departments that contribute data to INEP.

### list_packages
Lists all available educational dataset packages (like ENEM or IDEB).

### list_tags
Retrieves a list of predefined tags used to categorize INEP data.

### search_datastore_sql
Runs advanced queries using SQL syntax against the raw data in a datastore.

### search_datastore
Searches for specific pieces of information directly within a large, live dataset resource.

### search_packages
Searches across all available dataset packages by name or keyword.

### search_resources
Finds specific data files or components within the INEP catalog structure.

## Prompt Examples

**Prompt:** 
```
Search for all available datasets related to 'Censo Escolar'.
```

**Response:** 
```
I found several datasets for 'Censo Escolar', including annual microdata from 2010 to 2023. Would you like to see the details for the most recent one?
```

**Prompt:** 
```
List the resources and download URLs for the 'ENEM 2022' package.
```

**Response:** 
```
The 'ENEM 2022' dataset contains 4 resources, including the main microdata CSV and the documentation PDF. Here are the direct download links...
```

**Prompt:** 
```
Run a SQL query to get the first 10 records from resource 'd9e8f7a6-...' where the state is 'SP'.
```

**Response:** 
```
Querying the DataStore... I've retrieved 10 records for the state of São Paulo. The data includes school codes, names, and administrative categories.
```

## Capabilities

### Find available datasets
List all high-level educational packages and organizations within the INEP system.

### Inspect data resources
Get specific details about a dataset, including download links or structural information for CSVs and PDFs.

### Search metadata
Find specific datasets or tags by searching the catalog's descriptive index.

### Execute complex queries
Run structured, SQL-like commands to filter and extract rows from large internal data stores.

### Retrieve structural details
Fetch specific information about groups or organizations by their unique IDs.

## Use Cases

### Investigating regional disparities in high school performance
The analyst needs to compare ENEM scores year-over-year across multiple states. They use the MCP to first find all relevant packages using `search_packages`, then execute a complex SQL query via `search_datastore_sql` that filters by state code and academic year, delivering a clean comparative table.

### Quickly validating data for an article
A journalist needs the most recent school infrastructure counts. They use `list_tags` to find 'school infrastructure,' then use `search_resources` to locate the specific CSV file and retrieve its direct download link, bypassing the main portal interface.

### Mapping departmental data ownership
A policy analyst needs to know which INEP department (organization) owns the IDEB metrics. They run `list_organizations` to identify the responsible body and use `get_organization` for their specific contact details.

### Determining data scope for a new project
A researcher needs to know if 'Censo Escolar' has microdata from 2010 to 2023. They use `list_groups` to see the available thematic groupings, then use `get_group` to confirm the data scope and variable depth.

## Benefits

- Stop sifting through folders. Use `list_packages` and `search_packages` to quickly narrow down the exact dataset you need without guessing names.
- Skip manual joins. Running a query with `search_datastore_sql` lets you filter millions of records using standard SQL syntax, getting targeted results immediately.
- No more downloading massive files just to check metadata. Use `get_package` or `get_resource` to inspect the structure and find direct download links for specific data components.
- The entire INEP catalog is searchable. If you need a resource on 'Censo Escolar' but don't know its exact package name, use `search_resources` to pinpoint it.
- Understand data hierarchy instantly. You can map the relationships between departments using `list_organizations` and then drill down with `get_group`.

## How It Works

The bottom line is that you interact with the data through natural language prompts; the MCP handles all the complicated API calls underneath.

1. First, subscribe to the Inep Dados Abertos MCP. You may need an INEP API Key if your work requires specific access rights, but public queries usually connect immediately.
2. Then, prompt your AI client with a request—for example, asking it to list all available educational packages or running a query against a known dataset resource.
3. The system executes the necessary search or retrieval function and returns clean, structured data directly into your conversation thread.

## Frequently Asked Questions

**How do I find out what datasets are available using list_packages?**
Using `list_packages` gives you a master list of all major educational data sets, like ENEM or IDEB. If you need to focus on one type, follow up by running `search_packages` with keywords.

**What is the difference between search_datastore and search_datastore_sql?**
`search_datastore` handles simpler text searches within a dataset. If you need to filter data using specific criteria, like 'state equals SP' or 'year greater than 2015,' use `search_datastore_sql`.

**I found a resource ID; how do I get its details? Use get_resource.**
The `get_resource` tool retrieves the full metadata for that specific data file. This is useful because it shows you structural info, download links, and other key details.

**Do I need to use list_organizations first?**
No. You can jump straight into searching or listing packages if you know the general data subject. However, `list_organizations` helps map out which governmental body is responsible for a specific dataset.

**What steps do I take to use my specific Inep API Key when calling get_package?**
The system allows both public and private credentials. To ensure proper access, pass your unique API key in the designated header or parameter field before running any data retrieval tool.

**I want to see all available research areas; how do I use list_tags?**
Running `list_tags` provides a comprehensive index of all metadata tags (like 'IDEB' or 'ENEM'). Use this list first to narrow your scope, guiding you toward the correct dataset package.

**How do I get specific details about a Ministry division using get_organization?**
You must identify the organization ID by running `list_organizations` first. Passing that unique ID to `get_organization` returns detailed metadata, helping you understand the department's focus.

**I don't know the package name; how do I find a resource using search_resources?**
This function searches across all available dataset metadata. It lets you locate specific resources by general keywords (like 'school infrastructure') even if you haven't identified the main parent dataset yet.

**Can I query specific data inside a resource without downloading the whole file?**
Yes! You can use the `search_datastore_sql` tool to run SQL queries directly against the Inep database for resources that support the DataStore API.

**How do I find datasets related to a specific topic like 'ENEM'?**
Use the `search_packages` tool with the query 'ENEM'. It will return all matching datasets, which you can then inspect using `get_package`.

**Is it possible to list all organizations that publish data on the portal?**
Yes, the `list_organizations` tool retrieves all departments and entities within Inep that maintain open data resources.