# SportDB MCP

> SportDB accesses live scores, standings, fixtures, and player data across football, basketball, hockey, and tennis. Your AI agent can pull detailed league tables, track real-time scores as they happen, or build a complete profile of any professional athlete. It's your single source for structured multi-sport sports data.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** live-scores, sports-data, league-standings, match-fixtures, real-time-updates, player-statistics

## Description

You've got a data problem. Instead of crawling multiple sports websites for stats, you let your agent hit SportDB directly. This server gives you structured access to multi-sport data—football, basketball, hockey, and tennis. You can pull everything from live scores on the field to deep dives into an athlete's career history.

To start anywhere, you use `list_countries` to get a list of available countries for any sport slug. From there, your agent runs `get_country_competitions` to find every league or cup tournament running in that country and specific sport; those results give you the necessary competition slugs needed to drill down.

**Finding Teams and Players**
You'll need IDs to pull details. If you know a team name, you run `search_clubs` to locate it by keyword, which returns its unique numeric ID. You then use that club ID with `get_club_profile` to grab the full profile for any specific club, or run `get_club_players`, requiring only the club's numeric ID, to list all players registered there.

If you're looking for a player, `search_players` lets you locate them by name keyword, returning their necessary numeric ID. Once you have that ID, your agent can pull the full personal and career details using `get_player_profile`. For deep performance metrics, run `get_player_stats`, which requires only the player's numeric ID to get seasonal and overall career numbers. You can also track an athlete’s entire history by running `get_player_transfers` with their unique ID.

**Tracking Live Action and Schedules**
For any sport, you first need a schedule or score. If you want the full slate of upcoming or completed games, use `get_fixtures`, specifying the sport, country, competition, and season details. For real-time action, your agent pulls live scores instantly: run `get_live_football` for ongoing soccer matches; use `get_live_basketball` for active court games; or call `get_live_hockey` for current ice hockey scores.

When you need comprehensive data on a single game—like its basic details, who played, and what happened—you run `get_match` with the match's unique ID. You can also get the starting players, substitutes, and formations by calling `get_match_lineups`, or pull detailed in-game statistics like shots and fouls using `get_match_stats`. The match data is always tied to a specific Match ID.

**Analyzing League Context**
To understand league status, your agent first checks all available seasons for a competition slug using `get_competition_seasons`. To see how teams stack up, you run `get_standings` with the season and competition details; this calculates and returns the official league table—showing points, wins, losses, and goal difference. Finally, if you just need to know which leagues are running in a specific country for a sport, use `get_country_competitions`.

## Tools

### get_club_players
Lists all players currently registered with a club, requiring only the club's numeric ID.

### get_club_profile
Retrieves the full profile details for any specific club using its unique numeric ID.

### get_competition_seasons
Lists all available seasons (e.g., 2023-2024) for a given sport competition slug.

### get_country_competitions
Finds every league or cup tournament running in a country and sport, giving you the necessary slugs to drill down.

### get_fixtures
Gets the schedule and scores for completed or upcoming matches based on sport, country, competition, and season.

### get_match
Retrieves comprehensive data about a single match using its unique ID, including basic details.

### get_match_lineups
Gets the starting players and substitutes for a specific game by providing the match ID.

### get_match_stats
Pulls detailed, in-game statistics (shots, fouls, etc.) for a specific match using its ID.

### get_player_profile
Retrieves the full personal and career profile of any player by providing their numeric ID.

### get_player_stats
Gets a player’s seasonal and career performance statistics, requiring only their numeric player ID.

### get_player_transfers
Lists every club transfer history for a specific athlete using their numeric ID.

### get_standings
Calculates and returns the official league table standings (points, W/D/L) for a defined season and competition.

### list_countries
Lists all countries available within a chosen sport slug, serving as the starting point for data queries.

### get_live_basketball
Fetches real-time scores for basketball games that are currently active (e.g., NBA/EuroLeague).

### get_live_football
Provides live, up-to-the-minute scores and status updates for ongoing soccer matches.

### get_live_hockey
Gets the current match scores for active ice hockey games (e.g., NHL/KHL).

### search_clubs
Finds clubs or teams by name keyword and returns their unique IDs needed for subsequent profile calls.

### search_players
Locates players using a name keyword, giving you the numeric ID required to pull detailed stats or profiles.

## Prompt Examples

**Prompt:** 
```
Show me the live football scores right now.
```

**Response:** 
```
I've retrieved the live matches. There are currently 4 active games: Manchester City 2–1 Arsenal (67'), Real Madrid 0–0 Atlético Madrid (32'), Flamengo 1–0 Palmeiras (55'), and Bayern Munich 3–2 Dortmund (81'). Would you like me to pull the match stats for any of these?
```

**Prompt:** 
```
Search for Erling Haaland and show me his transfer history.
```

**Response:** 
```
Found Erling Haaland (ID: 48291). Here is his transfer history: Bryne FK → Molde FK (Jan 2017), Molde FK → Red Bull Salzburg (Jan 2019, €5M), Red Bull Salzburg → Borussia Dortmund (Jan 2020, €20M), Borussia Dortmund → Manchester City (Jul 2022, €60M). Would you like to see his seasonal statistics?
```

**Prompt:** 
```
Get the La Liga standings for the 2024-2025 season.
```

**Response:** 
```
Here are the La Liga 2024-2025 standings: 1. Barcelona — 52 pts (W16 D4 L2), 2. Real Madrid — 48 pts (W15 D3 L4), 3. Atlético Madrid — 43 pts (W13 D4 L5). The table includes 20 teams with full records. Want me to pull the upcoming fixtures for any of these clubs?
```

## Capabilities

### Get live scores
Retrieves current, real-time results for ongoing matches in football, basketball, or hockey.

### Find league standings and tables
Pulls the full league table—including points, wins, losses, and goal difference—for any specific season.

### Search for players or clubs
Uses name keywords to locate a specific player ID or club ID required for detailed queries.

### View match details and lineups
Gathers comprehensive information about one game, including the starting XI, substitutions, and formations.

### Analyze player career statistics
Retrieves a player's complete record of seasonal metrics, performance history, and transfer movements.

## Use Cases

### Drafting a halftime report
A journalist needs to write an article about a matchup. They ask their agent: 'Get everything on the Manchester Derby.' The agent first uses `search_clubs` to confirm IDs, then runs `get_fixtures` for the match details, and finally pulls both `get_match_lineups` and `get_match_stats` to write out who played where and how many shots were taken.

### Tracking a player's career arc
A scout wants to evaluate a prospect. They ask the agent for 'Player X's full history.' The agent runs `search_players` to get the ID, then calls `get_player_stats` (for performance) and `get_player_transfers` (for market value), giving the scout a complete picture.

### Checking league dominance
A user wants to know who's leading in Italy. They prompt: 'What are the current Serie A standings for 2024?' The agent uses `list_countries` to find Italy, then `get_country_competitions` to find Serie A's slug, and finally calls `get_standings` with the correct season identifier.

### Comparing two rival squads
A manager wants a tactical comparison. They tell their agent: 'Compare the current starting lineup of Club A vs Club B.' The agent uses `search_clubs`, gets both club IDs, and then calls `get_club_players` to pull the roster for both sides.

## Benefits

- Stop clicking across multiple sites. `get_standings` pulls a complete league table instantly, consolidating points, wins, draws, and losses into one structured output.
- Get real-time data without waiting. Use tools like `get_live_football` or `get_live_basketball` to pull scores that are happening right now, making your reports current.
- `search_players` and `search_clubs` eliminate the guesswork of IDs. You just type a name, and you get the ID needed for deeper analysis with tools like `get_player_profile`.
- Understand player value fully. Instead of just knowing goals scored, use `get_player_stats` and `get_player_transfers` to build a full career performance model.
- Streamline complex searches. By first calling `list_countries` or `get_country_competitions`, your agent builds the precise path needed before querying fixtures with `get_fixtures`.

## How It Works

The bottom line is: Your AI client chains multiple calls together—search, identify scope, retrieve core data, then drill down into specifics—to build a single, comprehensive answer.

1. First, let your AI agent use `list_countries` or `get_country_competitions` to define the sport and league you care about.
2. Next, run a specific tool like `get_fixtures` (for upcoming games) or `get_live_football` (for active matches) using the identified slugs and seasons.
3. Finally, your agent uses the resulting IDs (e.g., a match ID or player ID) to pull deep data via tools like `get_match_stats` or `get_player_profile`.

## Frequently Asked Questions

**How do I use SportDB for live scores using `get_live_football`?**
Just ask your agent to run `get_live_football`. It returns an array of currently active matches, including the teams and the minute status. You can then follow up by asking for match stats on a specific game.

**What is the first step when I want league standings using `get_standings`?**
You must use `list_countries` or `get_country_competitions` to find the correct country slug and competition slug. Then, you pass those slugs along with the season identifier to `get_standings`.

**`search_players` returns what information?**
It finds players by name keyword and provides their unique numeric player ID along with basic profile data. You need this ID to call any detailed tool like `get_player_stats` or `get_player_profile`.

**Can I get the roster of a team using `get_club_players`?**
Yes, but first you need the club's ID. Use `search_clubs` to find the club name and get its numeric ID. Then pass that ID into `get_club_players`.

**Before I use `get_club_profile`, how do I find the required club ID?**
You must run `search_clubs` first. This tool returns a list of matching clubs, providing their unique IDs and basic metadata. Use one of these returned IDs when calling `get_club_profile` to fetch the full team profile.

**What inputs does `get_fixtures` require?**
The tool requires four key inputs: sport, country slug, competition slug, and a season. The combination of these parameters tells the agent exactly which matches to pull—whether they are upcoming schedules or scores from completed games.

**How do I get standings data for different historical years using `get_competition_seasons`?**
Run `get_competition_seasons` with the competition slug to list all available season identifiers. You must then use one of those specific season slugs in your subsequent calls to the `get_standings` tool.

**What information does `get_match_lineups` provide?**
It returns detailed starting lineups and substitutions for both teams within a single match. You must pass a valid match ID, which you can get from the live score tools or the general `get_fixtures` query.

**Can my AI agent show me live football scores while I work?**
Yes! Simply ask your agent to run the `get_live_football` tool and it will instantly retrieve all ongoing matches with real-time scores, minute markers, and status updates. You can also use `get_live_basketball` or `get_live_hockey` for other sports.

**How do I find the Premier League standings for the current season?**
Navigate the hierarchy: first use `list_countries` with sport 'football', then `get_country_competitions` for 'england', then `get_competition_seasons` for 'premier-league', and finally `get_standings` with the season slug. Your agent can chain these steps automatically from a simple question like 'Show me the Premier League table'.

**Can the integration modify any data on SportDB, or is it strictly read-only?**
All 18 tools are strictly read-only query operations. The integration cannot create, update, or delete any data on SportDB. Your API key is used solely for authenticated reads, ensuring your account remains safe from any destructive operations.