# Junta de Andalucía MCP

> Junta de Andalucía (Portal) MCP connects your AI client to the official open data records of the Andalusian government. Use it to query, analyze, and retrieve public datasets directly through natural language conversation. Find everything from socio-economic statistics to environmental reports without manual searching.

## Overview
- **Category:** knowledge-management
- **Price:** Free
- **Tags:** andalucia, open-data, spain, ckan, public-sector

## Description

Need to pull specific data from a major governmental source? This MCP gives your agent access to the Junta de Andalucía Open Data Portal. You can ask questions in plain English—like, 'Show me all datasets related to water quality.' Your agent handles the complex querying needed to find and analyze public records.

It lets you map out the entire structure of their open data. Want to know which groups published a certain dataset? Or which specific organizations manage resource IDs? You can get that context immediately. The platform sits within Vinkius, giving your AI client access to thousands of other APIs, making this one part of a much bigger research toolset.

Whether you're tracking environmental trends or compiling public finance reports, the goal is simple: turn complex data portals into conversational queries. You get metadata, resource details, and structured answers without ever navigating an interface.

## Tools

### search_datastore
Performs deep, full-text searches across the content housed within specific data resources.

### list_groups
Lists every category or group that publishes data in the portal.

### list_organizations
Retrieves a full list of all official publishing organizations within the region.

### get_package
Fetches the detailed information for a specific dataset package ID.

### list_packages
Returns a simple list of all available dataset names in the portal.

### get_resource
Gets the metadata, including links and specs, for one particular file within a dataset.

## Prompt Examples

**Prompt:** 
```
List all available datasets in the Junta de Andalucía portal.
```

**Response:** 
```
I've retrieved the list of datasets. There are numerous packages available, including 'Presupuestos de la Comunidad', 'Centros Educativos', and 'Calidad del Aire'. Which category or specific dataset would you like to explore?
```

**Prompt:** 
```
Search for 'turismo' in the resource with ID 550e8400-e29b-41d4-a716-446655440000.
```

**Response:** 
```
Searching the datastore... I found 12 entries matching 'turismo' in that resource. The results include data on hotel occupancy and local attractions. Would you like me to summarize the top results?
```

**Prompt:** 
```
Show me the metadata for the dataset 'centros-sanitarios'.
```

**Response:** 
```
Fetching metadata for 'centros-sanitarios'... This dataset contains information about all health centers in Andalusia, updated monthly. It includes 3 resources in CSV and JSON formats. Would you like the IDs of these resources?
```

## Capabilities

### Find available datasets
Lists all published dataset packages in the portal so you can see what's available.

### Get metadata for a dataset
Retrieves detailed information—like format and update frequency—for one specific dataset package.

### Inspect individual files (resources)
Provides technical specifications and direct access links for a single file within a dataset.

### Map organizational structure
Lists every publishing organization or group, helping you understand the data's source hierarchy.

### Search specific data fields
Runs a full-text search query across the content of an individual dataset resource.

## Use Cases

### Checking historical climate trends
A researcher needs atmospheric data from five different years. Instead of finding five separate URLs, they ask their agent to `list_packages` for 'environmental' data, then use `get_package` repeatedly until all required datasets are found and analyzed.

### Verifying department ownership
A policy analyst needs to know which government body manages the latest health statistics. They run `list_groups` to understand the data taxonomy, then use `list_organizations` to pinpoint the exact responsible entity.

### Finding specific keywords in old reports
A journalist is investigating 'tourism' impact from 2015. They must first find the resource ID and then run `search_datastore` on that ID, feeding the keyword to get precise answers.

### Building a data inventory for an app
A developer needs stable public endpoints. They use `get_resource` multiple times to collect metadata and direct access links for key files, compiling them into a structured list for their application.

## Benefits

- Pinpoint exact datasets using `list_packages`. Instead of scrolling through hundreds of results, you get a clean list to narrow your focus immediately.
- Check data reliability by running `get_package` or `get_resource`. You see the update frequency and file format before committing to analysis.
- Map out who owns what. Use `list_organizations` to build an organizational chart of data ownership, which is critical for compliance checks.
- Deep content searches are easy. The `search_datastore` tool lets you query specific records using full-text search, bypassing the need for complex database filters.
- Understand the structure at a high level. Running `list_groups` shows you all the available data categories, giving context to your research scope.

## How It Works

The bottom line is you talk to your agent, and the MCP translates that conversation into precise data queries against the Junta de Andalucía portal.

1. Subscribe to this MCP. If you need higher call limits, enter your Portal API Key.
2. Connect your preferred AI client (Claude, Cursor, etc.) through the Vinkius Marketplace.
3. Ask your agent a question like, 'List all datasets related to education' and it executes the necessary lookups.

## Frequently Asked Questions

**How do I find all available datasets using list_packages?**
The `list_packages` tool returns a simple, complete list of every dataset package name in the portal. This is your starting point when you don't know exactly what data exists.

**Can I search text inside a resource using search_datastore?**
Yes. You use `search_datastore` by providing the specific resource ID and the keyword. It then runs a full-text query to find matching entries within that file.

**What is the difference between get_package and get_resource?**
The difference is scope. `get_package` provides details about the whole dataset container (the package). `get_resource` drills down to a single, specific file within that package.

**Should I use list_organizations or list_groups?**
Use `list_organizations` when you need the legal entity responsible for publication. Use `list_groups` if you want to see how the data is categorized by topic within the portal.

**If I use list_packages or get_package, do I need an API key to prevent rate limits?**
Yes, entering your Portal API Key increases the rate limit significantly. This allows you to run more frequent and complex queries against the Andalusian data without hitting usage caps.

**What specific technical details does get_resource provide about a file?**
It gives you deep metadata, including direct access links and precise technical specifications for that resource. You'll find its format type (like CSV or JSON) and how frequently it updates.

**After using list_organizations, how do I map those organizations to their actual datasets?**
You must use the organization ID returned by list_organizations. Then, you can cross-reference that ID with list_packages or get_package to find their published data packages.

**When using search_datastore, what are my limitations on query parameters?**
The tool supports full-text searching and filtering. Be sure to include specific filters like dates or unique identifiers in your request for the most accurate results.

**How can I search for specific information inside a dataset's file?**
Use the `search_datastore` tool with the specific `resource_id`. You can provide a query string `q` to filter the rows and find exactly what you need within the data table.

**Can I see which government department published a specific dataset?**
Yes. You can use `list_organizations` to see all publishers or use `get_package` with the dataset ID to see the specific organization responsible for that data.

**Is an API key mandatory to use this server?**
No, the API key is optional. Most data on the Junta de Andalucía portal is public. However, providing a key via the `JUNTA_API_KEY` credential may help avoid rate limits during intensive usage.