# Ayuntamiento de Zaragoza MCP

> Ayuntamiento de Zaragoza MCP connects your AI client directly to Zaragoza's open data and city services. You can query public datasets for details on monuments, restaurants, or city infrastructure; submit complaints via Open311; check appointment availability; or even execute advanced SPARQL queries against the city's linked data.

## Overview
- **Category:** data-management
- **Price:** Free
- **Tags:** open-data, open311, citizen-services, city-infrastructure, public-records, service-requests

## Description

The challenge with municipal records is that every department uses a different website, and they all use different forms. You shouldn't have to navigate five separate portals just to report a pothole, find out if you can book an appointment, and then pull historical data on nearby buildings.

This MCP handles the complexity layer for Zaragoza City Council services. Your agent connects directly to multiple public datasets and administrative workflows using natural language. You don't click through confusing web forms; you just ask your AI client a question about the city—whether it’s querying structured data like restaurant listings or submitting an official service request. Because this connector is hosted on Vinkius, you get access to all these specialized municipal tools from one place. It lets you manage everything from finding public maps and listing available appointments to running deep semantic queries across the entire open data infrastructure.

## Tools

### book_appointment
This tool lets you book a municipal service appointment (Cita Previa).

### create_map
You can create a new collaborative map for mapping purposes.

### delete_map
This removes an existing collaborative map you created or inspected.

### execute_sparql_query
It runs a complex SPARQL query against the city's semantic web data endpoint for deep analysis.

### get_agenda_availability
You check if appointments are available on a specific day.

### get_agenda_detail
This retrieves detailed information about a specific scheduled appointment slot.

### get_map_detail
You fetch the specifics and contents of an existing collaborative map.

### get_my_appointments
This lists all appointments that you have personally booked with the city council.

### get_open311_request
You retrieve the status and details of a specific complaint or suggestion submitted through Open311.

### get_open311_service
This fetches the definition of an available service category within Open311.

### list_agendas
You can see a list of all currently offered appointment types and schedules.

### list_open311_requests
This lists multiple service requests submitted through the Open311 system.

### list_open311_services
You get a list of all available complaint and suggestion services (Quejas y Sugerencias).

### list_public_maps
This shows you a directory of public collaborative maps created for the city.

### list_user_maps
You list all collaborative maps that belong specifically to your user account.

### query_dataset
This tool allows you to query general, structured city datasets like monuments or restaurants.

### submit_open311_request
You submit a formal new service request (a complaint or suggestion) via Open311.

## Prompt Examples

**Prompt:** 
```
Search for monuments in Zaragoza named 'Goya'.
```

**Response:** 
```
I found several results for 'Goya' in the monuments dataset, including the 'Monumento a Goya' located in Plaza del Pilar. Would you like the full details or coordinates?
```

**Prompt:** 
```
Report a cleaning issue at Calle Mayor 10 using Open311.
```

**Response:** 
```
I've submitted the request for 'Cleaning and Waste' at Calle Mayor 10. Your service request ID is 12345. You can track its status using the `get_open311_request` tool.
```

**Prompt:** 
```
Check availability for an appointment in the 'Padron' agenda for tomorrow.
```

**Response:** 
```
Checking the 'Padron' agenda... There are 3 available slots tomorrow: 09:00, 10:30, and 11:15. Would you like me to book one of these for you?
```

## Capabilities

### Query City Data
You retrieve information on specific city assets, like monuments or local businesses, by querying structured datasets.

### Report Citizen Issues
You submit complaints or suggestions directly to the Open311 system and track their status without logging into a separate portal.

### Manage Appointments
You check available time slots for municipal services and book an appointment using dedicated scheduling tools.

### Analyze Urban Data
You visualize, create, or inspect collaborative maps showing public infrastructure data.

### Run Deep Queries
You execute complex SPARQL queries to analyze relationships between different types of city records.

## Use Cases

### The Citizen Reporting Waste
A resident needs to report a large pile of construction debris at their street corner. They ask the agent to 'Report waste collection issue.' The agent automatically uses list_open311_services first, then submits the request using submit_open311_request, giving the user an immediate tracking ID.

### The Researcher Mapping Assets
A researcher needs to visualize all public historical monuments near a specific plaza. They ask the agent to 'Find and map all Goya-related monuments.' The agent uses query_dataset to gather coordinates, then calls create_map to generate a sharable visualization.

### The Tourist Checking Local Spots
A tourist wants dinner recommendations near their hotel. They ask the agent for 'highly-rated restaurants open after 9 PM.' The agent executes query_dataset against the restaurant dataset and returns a curated list with details.

## Benefits

- You bypass complex forms. Instead of navigating separate websites to file a complaint, you use submit_open311_request to log the issue directly with your agent.
- Scheduling is simple. You never have to guess if an appointment slot exists; check availability for appointments using get_agenda_availability and then book it instantly with book_appointment.
- Deep data analysis becomes trivial. Stop searching through PDFs; run complex queries against linked data using execute_sparql_query, getting structured results immediately.
- Mapping is easier. You can list public maps using list_public_maps to find the right visual context before you even need to create a new one with create_map.
- It centralizes everything. Instead of remembering which API handles appointments versus open data queries, this MCP groups all city functions into one conversational interface.

## How It Works

The bottom line is: you talk to your agent once, and it handles all the complex API calls required to get you the answer.

1. First, subscribe to this MCP and provide your necessary API keys. The client then authenticates against the Zaragoza City Council open data platform.
2. Next, you instruct your AI agent on the task—for example, 'List all public maps in the downtown area.' The agent translates that intent into the correct tool call (e.g., list_public_maps).
3. Finally, the MCP executes the request and returns the structured data or status update directly to your client for you to read.

## Frequently Asked Questions

**How do I check appointment availability using get_agenda_availability?**
You simply ask the agent to check availability for a specific service and date. The tool retrieves real-time data, telling you exactly which time slots are open.

**Is query_dataset meant for all city info?**
query_dataset is designed for structured public datasets, like listing monuments or restaurants. It lets your agent pull specific facts about known entities.

**What's the difference between list_open311_requests and get_open311_request?**
list_open311_requests shows you a directory of multiple requests. Use get_open311_request when you already have an ID and just need to check that specific item's status.

**Can I run advanced queries using execute_sparql_query?**
Yes, this tool lets your agent execute complex SPARQL queries directly against the city's semantic web data for deep analysis of linked records.

**After using list_public_maps, how do I retrieve specific details about a map with get_map_detail?**
You must pass the unique ID of the map you want information on. This tool pulls metadata like who created it and when it was last modified. It's useful for checking permissions or visualizing which data sources are attached to a collaborative map.

**What is required to successfully execute an appointment booking using book_appointment?**
You need three key pieces of information: the specific agenda ID, the desired date, and the time slot. The tool confirms if that combination is available before submitting your request for a reservation.

**If I want to submit an issue using submit_open311_request, what authentication do I need?**
You must provide valid client credentials as specified by the API. Successful submission requires confirming both the user's identity and the precise location of the issue you are reporting.

**How can I determine the scope of service definitions using get_open311_service?**
This tool provides a clear definition of what Open311 tracks. It tells your agent exactly what categories and types of complaints or suggestions are recognized by the city council.

**How can I find specific monuments or restaurants in Zaragoza?**
Use the `query_dataset` tool. You can specify the dataset (e.g., 'monumento' or 'restaurante') and apply filters like 'q' for names or 'point' and 'distance' for proximity searches.

**Can I report a broken street light or a pothole using this server?**
Yes! Use the `submit_open311_request` tool. You'll need to provide the `service_code` (which you can find via `list_open311_services`) and a description of the issue.

**How do I check if there are available slots for a city hall appointment?**
First, list available agendas with `list_agendas`, then use `get_agenda_availability` with the specific agenda ID to see open time slots.