# OpenLigaDB MCP

> OpenLigaDB provides your AI agent direct access to massive amounts of football data. Use it to audit historical match results, pull current league standings, and check upcoming fixtures for any supported sport or season. It lets you run complex sports intelligence queries—like calculating a team's win percentage over the last five seasons—without ever opening a dedicated stats app.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** football, match-results, league-standings, sports-data, fixtures

## Description

**OpenLigaDB** gives your agent direct access to massive, structured football data. Forget scraping websites or dealing with clunky APIs; you just tell your AI client what league and season you're interested in, and it handles the heavy lifting.

Your agent acts like a specialized sports analyst that pulls directly from the OpenLigaDB database. You can run complex queries—like figuring out a team's exact win percentage over five years or checking every single match result for an entire campaign—all through natural language conversation with your agent.

To start, your agent first runs `list_available_leagues`. This tool pulls a comprehensive directory listing of every competition the OpenLigaDB catalog supports. You use this to figure out exactly where you need to point your data requests, making sure you know all the available leagues before you do anything else.

Once you've identified the league, you can immediately check the current status using `get_league_table`. This tool retrieves real-time standings for any season and league. It provides up-to-date rank information, including a team’s total points accumulated, their goal difference, and their precise position in the table. You get this data instantly for every single club involved.

Need to know what's happening next? Your agent uses `get_next_league_match` to identify the scheduled game coming up in your chosen league. It gives you the date of that match and names the two teams playing, so you never miss a fixture announcement.

If you need to look back at history, `get_league_matches` pulls all the match results for an entire season within a specified league. You're not getting just scores; you get full details and outcomes for every single game that took place during that period, letting you audit the whole season's performance.

Deep diving into one particular day? Use `get_match_details`. By providing a unique match ID, this tool pulls specific metadata for one single game. You can find out exactly who scored goals, what the final scores were, and when those events happened without having to pull in all the surrounding season data.

Every piece of information—the standings, upcoming games, historical results, or granular goal details—is handled by your agent's tool calls. It processes the raw JSON response from OpenLigaDB and delivers a clean, actionable answer straight into your chat window. You don't write code; you just ask questions about football history, current league rankings, or future matchups. Your agent does the rest.

## Tools

### get_last_league_match
Retrieves data for the most recently played match in a specific league.

### get_league_matches
Pulls all match results and details for an entire season within a specified league.

### get_match_details
Fetches deep details, including goal scorers and specific scores, using a unique match ID.

### get_next_league_match
Identifies the next scheduled game in a league, providing date and team information.

### get_league_table
Gets the current, up-to-date standing table (points, goals) for any given league and season.

### list_available_leagues
Returns an exhaustive list of every competition available in the OpenLigaDB catalog.

## Prompt Examples

**Prompt:** 
```
Show results for Bundesliga 1 (bl1) season 2023 using OpenLigaDB.
```

**Response:** 
```
I've retrieved the match results for Bundesliga 1. Notable scores include Bayern Munich vs Dortmund. Would you like the standing table for this season as well?
```

**Prompt:** 
```
What is the next match in 'bl1'?
```

**Response:** 
```
The next match in Bundesliga 1 is identified. It features Leverkusen vs Stuttgart scheduled for this weekend. Would you like the venue details or past results for these teams?
```

**Prompt:** 
```
List all available leagues in OpenLigaDB.
```

**Response:** 
```
I've scanned the catalog. Available leagues include Bundesliga 1 (bl1), Bundesliga 2 (bl2), and various international cups. I can provide the shortcuts for any of these to retrieve more data.
```

## Capabilities

### List available competitions
Your agent pulls a directory listing of all leagues supported by OpenLigaDB so you know where to start.

### Get current league standings
It retrieves the real-time point, goal difference, and position data for every team in a given league season.

### Fetch past match results
You can request full scores and details for any completed match within a specified league and season.

### Check upcoming fixtures
The agent identifies the next scheduled match in a league, providing dates and participating teams.

### Get detailed match metadata
You pull specific information for one match ID—like who scored or when it happened—without needing to retrieve all surrounding data.

## Use Cases

### Updating a weekly team roundup.
The sports blogger needs the most current league standings for five different European leagues by 10 AM. Instead of manually checking each site, they ask their agent to call `get_league_table` for all five codes in sequence. The agent aggregates and presents one clean markdown table instantly, letting them hit 'publish' without delay.

### Verifying a historical score.
A data analyst needs confirmation of the exact goal details (scorer, minute) from a match that happened three seasons ago. They use `get_match_details` with the specific Match ID. This bypasses all general search results and pulls only the granular scoring metadata needed for their report.

### Creating a prediction piece.
A content lead wants to write about upcoming rivalries. They use `list_available_leagues` first, then run `get_next_league_match` for the top three leagues. The agent pulls all future matchups, allowing them to structure an entire article based on verified future fixtures.

### Building a multi-season trend report.
A data researcher wants to see how Team X's performance has changed over the last three years. They use `get_league_matches` repeatedly for different seasons, feeding all the results into their agent, which then aggregates and analyzes the total number of wins or losses across the entire period.

## Benefits

- **Get live standing tables with `get_league_table`**. Instead of clicking through tabs on a sports site, your agent gives you the current ranking structure—points, goal difference, everything—in one chat response. This is critical for running round-up content quickly.
- **Audit deep historical data using `get_league_matches` and `get_match_details`**. Need to know who scored in a specific match from 2018? You run the tool with a known Match ID, and your agent extracts that precise metadata. It's much faster than manual record searches.
- **Plan future content using `get_next_league_match`**. Stop guessing when games are. Your agent checks the schedule for any league and tells you exactly who plays next, letting you pre-write coverage pieces days in advance.
- **Identify all data sources with `list_available_leagues`**. If you're building a multi-sport platform, this tool lets you query every available competition name right away, saving you the headache of guessing league codes.
- **Streamline historical analysis with `get_last_league_match`**. Need to show a 'Last Week's Recap'? This single tool pulls that summary data instantly. It keeps your content fresh and always based on verifiable facts.

## How It Works

The bottom line is: You ask in plain English; the server handles the complex sports database calls and delivers a clean result.

1. Your AI client asks the agent a question, specifying a league and season (e.g., 'Show me Bundesliga 1 standings').
2. The agent identifies the required action and calls the necessary OpenLigaDB tool (e.g., `get_league_table`).
3. OpenLigaDB returns structured data to your agent, which formats it into a readable answer for you.

## Frequently Asked Questions

**How do I list every league available using OpenLigaDB MCP Server?**
Run the `list_available_leagues` tool. This returns a master directory of all supported competitions, letting you know exactly which codes to use for your other queries.

**Can I check current standings using get_league_table?**
Yes, `get_league_table` retrieves the most up-to-date point totals and league positions. Just make sure you specify both the correct league code and season year.

**What tool do I use to see past scores?**
You need `get_league_matches`. This pulls all matches for a given league and season, allowing you to audit historical results. Don't confuse this with looking at the last match only.

**Do I need an API key for OpenLigaDB MCP Server?**
No. OpenLigaDB is designed as a public service, so connecting the server requires no personal keys or complex authentication setup on your end.

**How do I use get_next_league_match to find upcoming fixtures?**
It retrieves detailed information about a league's next scheduled game. You provide the league identifier, and it returns the opponent, date, and time for that single fixture. This is useful for quickly checking if a team plays this week without pulling up all future schedules.

**What is the difference between get_league_matches and get_match_details?**
get_league_matches pulls every match result for an entire league and season. Use get_match_details when you already have a specific Match ID and only need the full metadata—like goal scorers or card details—for that single game.

**What happens if I use get_league_table with an invalid season?**
The tool requires valid league and season parameters. If you provide a non-existent combination, the server will return an error or an empty data set. You must verify your league/season codes before making the call.

**How do I use list_available_leagues to build a custom dataset?**
list_available_leagues only provides the catalog of available leagues and their identifiers. After running this, you must iterate through the resulting codes and call other tools (like get_league_table) for each specific league you want data from.

**Is an API Key required for OpenLigaDB?**
No. OpenLigaDB is a public and community-driven service. This server works out of the box without any static credentials required.

**What leagues are supported?**
OpenLigaDB primarily covers German football (Bundesliga), but also supports many other international leagues. Use the `list_available_leagues` tool to see the full list.

**Can the agent show the next match for a team?**
Yes. Use the `get_next_league_match` tool providing the league shortcut. Your agent will identify the next upcoming event in that league instantly.