# SportsDB MCP

> SportsDB connects your AI agent to global sports data. It lets you search for teams, players, and events across 200+ leagues. You can retrieve current league standings (`get_league_table`), track past results (`get_last_events`), or check upcoming fixtures using precise tools.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** sports, football, scores, league-tables, player-stats

## Description

**SportsDB** connects your AI agent directly to global sports data. You can use this server to find out anything about sports—from who's playing next to checking a team’s entire history.

## Tools

### get_last_events
Retrieves a list of recent match results for a specified team.

### get_league_details
Gets detailed information about a specific league, including its rules and scope.

### get_league_table
Returns the current standing table for a league, showing points and goal differentials.

### get_next_events
Fetches upcoming scheduled matches or fixtures for a specific team.

### get_player_details
Retrieves detailed statistics and background information on an individual player.

### get_team_details
Gets comprehensive details for a specific sports team, including venue info and roster data.

### list_all_countries
Returns an exhaustive list of all countries that have associated sports data in the database.

### list_all_leagues
Provides a full listing of every league available for querying within the system.

### list_all_sports
Lists all sports covered by the database (e.g., Football, Basketball).

### search_events
Searches for general matches or events using a keyword or name.

### search_players
Finds player metadata and basic profiles by name, including their team and nationality.

### search_teams
Locates sports teams by name, returning core data like ID, sport, league, and country.

## Prompt Examples

**Prompt:** 
```
Show me the current Premier League standings.
```

**Response:** 
```
Here are the current Premier League standings: 1st Arsenal (78 pts), 2nd Man City (74 pts), 3rd Liverpool (72 pts). Arsenal have won 8 of their last 10 matches. Want to see upcoming fixtures?
```

## Capabilities

### Discover Global Scope
List all available sports, leagues, and countries in the database using `list_all_sports`, `list_all_leagues`, and `list_all_countries`.

### Search Specific Entities
Find players or teams by name using `search_players` or `search_teams`, then pull their full profiles with `get_player_details` or `get_team_details`.

### Track League Standings and History
Access current league rankings and points using `get_league_table`, or review past results for a team via `get_last_events`.

### Check Fixtures and Events
Look up upcoming matches for specific teams using `get_next_events`, or search for events by keyword using `search_events`.

### Get League Context
Retrieve detailed information about a league, including its rules and history, with the `get_league_details` tool.

## Use Cases

### Writing a season review article
A journalist needs to write about Manchester United's performance shift. They use `get_team_details` first to get background info, then call `get_last_events` to pull the last 10 match scores. Finally, they combine this data with `get_league_table` results to frame their narrative.

### Building a cross-sport roster tracker
A developer wants an app that tracks top players across multiple sports. They start by calling `list_all_sports`, then iterate through the list, using `search_players` for each sport to build a master index before pulling full stats with `get_player_details`.

### Pre-game analysis for fantasy picks
A fantasy manager needs to know if a player has been injured. They first use `search_players` to find the ID, then check `get_next_events` for that team's upcoming schedule. If no event is listed or the details show inactivity, they flag the risk.

### Scope checking for a new vertical
You need to know if you can cover Brazilian soccer data. You run `list_all_countries` and confirm 'Brazil' exists. Next, you use `list_all_leagues` filtered by country to identify the specific leagues available.

## Benefits

- Check current standings fast. Use `get_league_table` to pull up-to-date points and goal differentials for any league without writing SQL queries.
- Research team deep cuts quickly. Run `get_team_details` to see a club's venue, history, and full roster information in one go.
- Map the whole database structure. Start by calling `list_all_countries`, then `list_all_leagues` to scope out every possible data point available.
- Track performance over time. Use `get_player_details` to compare a player's stats across seasons, or use `get_last_events` to see their recent run of form.
- Find anything by name. If you only know the team or event name, start with `search_teams` or `search_events` before drilling down for details.

## How It Works

The bottom line is that you ask natural questions, and the agent executes the precise API calls needed to get the numbers back.

1. First, tell your agent what you're looking for—a team name, a sport, or a specific league. For example: 'What are the standings for the Premier League?'
2. Your AI client calls the necessary tool (like `get_league_table`) and passes the required parameters (the league ID).
3. The server returns structured JSON data containing current points, goals, and rankings directly to your agent for immediate use.

## Frequently Asked Questions

**How do I check current league standings using get_league_table?**
You must provide the specific ID for the league you care about. The agent calls `get_league_table` and returns a structured list of points, goals, and rankings for all participating teams.

**What is the difference between search_teams and get_team_details?**
`search_teams` finds the team by name and gives basic metadata. `get_team_details` takes a specific ID and returns everything: roster, venue, full history.

**Can I find out what leagues are available? (list_all_leagues)**
Yes. Run `list_all_leagues`. This provides an exhaustive list of all league IDs and names in the database, letting you map your data scope.

**How do I see upcoming games for a team? (get_next_events)**
Pass the target team's ID to `get_next_events`. It returns scheduled fixtures with dates and opponents, so you know what to expect next.

**Does SportsDB cover all sports? (list_all_sports)**
No. Run `list_all_sports` first. This shows exactly which sports are in the database, keeping your queries focused and reliable.

**How do I use search_events if I don't know the league or team? (search_events)**
The tool searches for matches using keywords, not just by name. You provide a keyword, and it returns matching events across all leagues. This is useful when you only remember part of the match description.

**What specific metadata does get_player_details give me? (get_player_details)**
It provides detailed player information including career stats, badges, and associated venues. It goes beyond simple performance metrics to build a full profile for the individual.

**If I need data only from a specific region, how do I use list_all_countries? (list_all_countries)**
This tool lists every country covered by the database. You run this first to get a comprehensive ID list, then pass that country code when calling other tools for targeted results.

**What sports are supported?**
SportsDB covers 200+ leagues across football (soccer), basketball, baseball, American football, ice hockey, motorsport, tennis, rugby, cricket, and many more.