diff --git a/apps/docs/content/docs/en/integrations/sportmonks.mdx b/apps/docs/content/docs/en/integrations/sportmonks.mdx index 21383de4d6f..f3d3d673742 100644 --- a/apps/docs/content/docs/en/integrations/sportmonks.mdx +++ b/apps/docs/content/docs/en/integrations/sportmonks.mdx @@ -12,152 +12,118 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" ## Usage Instructions -Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, teams, squads, players, standings, and topscorers. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones. +Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, seasons, stages, rounds, teams, squads, players, coaches, referees, venues, standings, topscorers, transfers, schedules, commentaries, TV stations, rivals, expected goals (xG), and predictions. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones. ## Actions -### `sportmonks_football_get_livescores` +### `sportmonks_football_expected_by_player` -Retrieve fixtures starting within 15 minutes and currently in progress from Sportmonks +Retrieve lineup-level expected goals (xG) values per player from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events\) | -| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;player;team;type\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of live fixture objects | -| ↳ `id` | number | Unique id of the fixture | -| ↳ `sport_id` | number | Sport the fixture is played at | -| ↳ `league_id` | number | League the fixture is played in | -| ↳ `season_id` | number | Season the fixture is played in | -| ↳ `stage_id` | number | Stage the fixture is played in | -| ↳ `group_id` | number | Group the fixture is played in | -| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | -| ↳ `round_id` | number | Round the fixture is played in | -| ↳ `state_id` | number | State \(status\) of the fixture | -| ↳ `venue_id` | number | Venue the fixture is played at | -| ↳ `name` | string | Name of the fixture \(participants\) | -| ↳ `starting_at` | string | Datetime the fixture starts | -| ↳ `result_info` | string | Final result summary | -| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Length of the fixture in minutes | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Whether odds are available | -| ↳ `has_premium_odds` | boolean | Whether premium odds are available | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `expected` | array | Array of player-level expected goals \(xG\) entries | +| ↳ `id` | number | Unique id of the expected value | +| ↳ `fixture_id` | number | Fixture related to the value | +| ↳ `player_id` | number | Player related to the value | +| ↳ `team_id` | number | Team related to the value | +| ↳ `lineup_id` | number | Lineup record the player relates to | +| ↳ `type_id` | number | Type of the expected value | +| ↳ `data` | object | The expected value payload | +| ↳ `value` | number | The xG value | -### `sportmonks_football_get_inplay_livescores` +### `sportmonks_football_expected_by_team` -Retrieve all fixtures that are currently being played (in-play) from Sportmonks +Retrieve fixture-level expected goals (xG) values per team from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events\) | -| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;participant;type\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of in-play fixture objects | -| ↳ `id` | number | Unique id of the fixture | -| ↳ `sport_id` | number | Sport the fixture is played at | -| ↳ `league_id` | number | League the fixture is played in | -| ↳ `season_id` | number | Season the fixture is played in | -| ↳ `stage_id` | number | Stage the fixture is played in | -| ↳ `group_id` | number | Group the fixture is played in | -| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | -| ↳ `round_id` | number | Round the fixture is played in | -| ↳ `state_id` | number | State \(status\) of the fixture | -| ↳ `venue_id` | number | Venue the fixture is played at | -| ↳ `name` | string | Name of the fixture \(participants\) | -| ↳ `starting_at` | string | Datetime the fixture starts | -| ↳ `result_info` | string | Final result summary | -| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Length of the fixture in minutes | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Whether odds are available | -| ↳ `has_premium_odds` | boolean | Whether premium odds are available | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `expected` | array | Array of team-level expected goals \(xG\) entries | +| ↳ `id` | number | Unique id of the expected value | +| ↳ `fixture_id` | number | Fixture related to the value | +| ↳ `type_id` | number | Type of the expected value | +| ↳ `participant_id` | number | Team related to the expected value | +| ↳ `data` | object | The expected value payload | +| ↳ `value` | number | The xG value | +| ↳ `location` | string | Home or away | -### `sportmonks_football_get_fixtures_by_date` +### `sportmonks_football_get_all_commentaries` -Retrieve all football fixtures on a specific date (YYYY-MM-DD) from Sportmonks +Retrieve all textual commentaries available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `date` | string | Yes | The date to fetch fixtures for, in YYYY-MM-DD format | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;league\) | -| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501,271\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;player\) | +| `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of fixture objects for the requested date | -| ↳ `id` | number | Unique id of the fixture | -| ↳ `sport_id` | number | Sport the fixture is played at | -| ↳ `league_id` | number | League the fixture is played in | -| ↳ `season_id` | number | Season the fixture is played in | -| ↳ `stage_id` | number | Stage the fixture is played in | -| ↳ `group_id` | number | Group the fixture is played in | -| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | -| ↳ `round_id` | number | Round the fixture is played in | -| ↳ `state_id` | number | State \(status\) of the fixture | -| ↳ `venue_id` | number | Venue the fixture is played at | -| ↳ `name` | string | Name of the fixture \(participants\) | -| ↳ `starting_at` | string | Datetime the fixture starts | -| ↳ `result_info` | string | Final result summary | -| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Length of the fixture in minutes | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Whether odds are available | -| ↳ `has_premium_odds` | boolean | Whether premium odds are available | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `commentaries` | array | Array of commentary entries | +| ↳ `id` | number | Unique id of the commentary | +| ↳ `fixture_id` | number | Fixture related to the commentary | +| ↳ `comment` | string | The commentary text | +| ↳ `minute` | number | Match minute of the comment | +| ↳ `extra_minute` | number | Extra \(injury\) minute of the comment | +| ↳ `is_goal` | boolean | Whether the comment is a goal | +| ↳ `is_important` | boolean | Whether the comment is important | +| ↳ `order` | number | Order of the comment | -### `sportmonks_football_get_fixtures_by_date_range` +### `sportmonks_football_get_all_fixtures` -Retrieve football fixtures between two dates (YYYY-MM-DD) from Sportmonks. Max range is 100 days. +Retrieve all football fixtures available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `startDate` | string | Yes | Start date in YYYY-MM-DD format | -| `endDate` | string | Yes | End date in YYYY-MM-DD format \(max 100 days after start\) | | `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | -| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501,271\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of fixture objects within the requested date range | +| `fixtures` | array | Array of fixture objects | | ↳ `id` | number | Unique id of the fixture | | ↳ `sport_id` | number | Sport the fixture is played at | | ↳ `league_id` | number | League the fixture is played in | @@ -179,392 +145,368 @@ Retrieve football fixtures between two dates (YYYY-MM-DD) from Sportmonks. Max r | ↳ `has_premium_odds` | boolean | Whether premium odds are available | | ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | -### `sportmonks_football_get_fixture` +### `sportmonks_football_get_all_players` -Retrieve a single football fixture by its ID from Sportmonks +Retrieve all football players available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `fixtureId` | string | Yes | The unique id of the fixture | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events;lineups;statistics\) | -| `filters` | string | No | Filters to apply \(e.g. eventTypes:14\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. nationality;position\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order players by id \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixture` | object | The requested fixture object | -| ↳ `id` | number | Unique id of the fixture | -| ↳ `sport_id` | number | Sport the fixture is played at | -| ↳ `league_id` | number | League the fixture is played in | -| ↳ `season_id` | number | Season the fixture is played in | -| ↳ `stage_id` | number | Stage the fixture is played in | -| ↳ `group_id` | number | Group the fixture is played in | -| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | -| ↳ `round_id` | number | Round the fixture is played in | -| ↳ `state_id` | number | State \(status\) of the fixture | -| ↳ `venue_id` | number | Venue the fixture is played at | -| ↳ `name` | string | Name of the fixture \(participants\) | -| ↳ `starting_at` | string | Datetime the fixture starts | -| ↳ `result_info` | string | Final result summary | -| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Length of the fixture in minutes | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Whether odds are available | -| ↳ `has_premium_odds` | boolean | Whether premium odds are available | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `players` | array | Array of player objects | +| ↳ `id` | number | Unique id of the player | +| ↳ `sport_id` | number | Sport of the player | +| ↳ `country_id` | number | Country of birth of the player | +| ↳ `nationality_id` | number | Nationality of the player | +| ↳ `city_id` | number | City of birth of the player | +| ↳ `position_id` | number | Position of the player | +| ↳ `detailed_position_id` | number | Detailed position of the player | +| ↳ `type_id` | number | Type of the player | +| ↳ `common_name` | string | Name the player is known for | +| ↳ `firstname` | string | First name of the player | +| ↳ `lastname` | string | Last name of the player | +| ↳ `name` | string | Name of the player | +| ↳ `display_name` | string | Display name of the player | +| ↳ `image_path` | string | URL to the player headshot | +| ↳ `height` | number | Height of the player in cm | +| ↳ `weight` | number | Weight of the player in kg | +| ↳ `date_of_birth` | string | Date of birth of the player | +| ↳ `gender` | string | Gender of the player | -### `sportmonks_football_get_head_to_head` +### `sportmonks_football_get_all_rivals` -Retrieve the head-to-head fixtures between two teams from Sportmonks +Retrieve all teams with their rivals information from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `team1` | string | Yes | The id of the first team | -| `team2` | string | Yes | The id of the second team | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. team;rival\) | | `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of head-to-head fixture objects between the two teams | -| ↳ `id` | number | Unique id of the fixture | -| ↳ `sport_id` | number | Sport the fixture is played at | -| ↳ `league_id` | number | League the fixture is played in | -| ↳ `season_id` | number | Season the fixture is played in | -| ↳ `stage_id` | number | Stage the fixture is played in | -| ↳ `group_id` | number | Group the fixture is played in | -| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | -| ↳ `round_id` | number | Round the fixture is played in | -| ↳ `state_id` | number | State \(status\) of the fixture | -| ↳ `venue_id` | number | Venue the fixture is played at | -| ↳ `name` | string | Name of the fixture \(participants\) | -| ↳ `starting_at` | string | Datetime the fixture starts | -| ↳ `result_info` | string | Final result summary | -| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Length of the fixture in minutes | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Whether odds are available | -| ↳ `has_premium_odds` | boolean | Whether premium odds are available | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `rivals` | array | Array of rival relationships | +| ↳ `sport_id` | number | Sport of the rival | +| ↳ `team_id` | number | Team the rivalry belongs to | +| ↳ `rival_id` | number | Rival team id | -### `sportmonks_football_get_leagues` +### `sportmonks_football_get_all_teams` -Retrieve all football leagues available within your Sportmonks subscription +Retrieve all football teams available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue\) | | `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order leagues \(asc or desc\) | +| `order` | string | No | Order teams by id \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `leagues` | array | Array of league objects | -| ↳ `id` | number | Unique id of the league | -| ↳ `sport_id` | number | Sport of the league | -| ↳ `country_id` | number | Country of the league | -| ↳ `name` | string | Name of the league | -| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | -| ↳ `short_code` | string | Short code of the league | -| ↳ `image_path` | string | URL to the league logo | -| ↳ `type` | string | Type of the league | -| ↳ `sub_type` | string | Subtype of the league | -| ↳ `last_played_at` | string | Date the last fixture was played | -| ↳ `category` | number | Importance category of the league \(1-4\) | +| `teams` | array | Array of team objects | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Home venue of the team | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the last played match | -### `sportmonks_football_get_league` +### `sportmonks_football_get_all_transfer_rumours` -Retrieve a single football league by its ID from Sportmonks +Retrieve all transfer rumours available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `leagueId` | string | Yes | The unique id of the league | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason;seasons\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | | `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `league` | object | The requested league object | -| ↳ `id` | number | Unique id of the league | -| ↳ `sport_id` | number | Sport of the league | -| ↳ `country_id` | number | Country of the league | -| ↳ `name` | string | Name of the league | -| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | -| ↳ `short_code` | string | Short code of the league | -| ↳ `image_path` | string | URL to the league logo | -| ↳ `type` | string | Type of the league | -| ↳ `sub_type` | string | Subtype of the league | -| ↳ `last_played_at` | string | Date the last fixture was played | -| ↳ `category` | number | Importance category of the league \(1-4\) | - -### `sportmonks_football_search_teams` - -Search for football teams by name from Sportmonks +| `transferRumours` | array | Array of transfer rumour objects | +| ↳ `id` | number | Unique id of the transfer rumour | +| ↳ `sport_id` | number | Sport of the transfer rumour | +| ↳ `player_id` | number | Player the rumour relates to | +| ↳ `position_id` | number | Position id of the player | +| ↳ `from_team_id` | number | Team the player would transfer from | +| ↳ `to_team_id` | number | Team the player would transfer to | +| ↳ `transfer_fee_id` | number | Transfer fee id of the rumour | +| ↳ `probability` | string | Probability of the rumour \(e.g. LOW\) | +| ↳ `source_name` | string | Name of the source of the rumour | +| ↳ `source_url` | string | URL of the source of the rumour | +| ↳ `amount` | number | Estimated transfer fee amount | +| ↳ `currency` | string | Currency of the amount | +| ↳ `date` | string | Date of the rumour | +| ↳ `type_id` | number | Type of the transfer rumour | + +### `sportmonks_football_get_all_transfers` + +Retrieve all transfers available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The team name to search for \(e.g. Celtic\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue\) | -| `filters` | string | No | Filters to apply | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply \(e.g. transferTypes:219,220\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order teams by id \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `teams` | array | Array of team objects matching the search query | -| ↳ `id` | number | Unique id of the team | -| ↳ `sport_id` | number | Sport of the team | -| ↳ `country_id` | number | Country of the team | -| ↳ `venue_id` | number | Home venue of the team | -| ↳ `gender` | string | Gender of the team | -| ↳ `name` | string | Name of the team | -| ↳ `short_code` | string | Short code of the team | -| ↳ `image_path` | string | URL to the team logo | -| ↳ `founded` | number | Founding year of the team | -| ↳ `type` | string | Type of the team | -| ↳ `placeholder` | boolean | Whether the team is a placeholder | -| ↳ `last_played_at` | string | Date and time of the last played match | - -### `sportmonks_football_get_team` - -Retrieve a single football team by its ID from Sportmonks +| `transfers` | array | Array of transfer objects | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_brackets_by_season` + +Retrieve the knockout-stage tournament bracket (stages and progression edges) for a season ID #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `teamId` | string | Yes | The unique id of the team | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue;coaches;players.player\) | -| `filters` | string | No | Filters to apply | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `team` | object | The requested team object | -| ↳ `id` | number | Unique id of the team | -| ↳ `sport_id` | number | Sport of the team | -| ↳ `country_id` | number | Country of the team | -| ↳ `venue_id` | number | Home venue of the team | -| ↳ `gender` | string | Gender of the team | -| ↳ `name` | string | Name of the team | -| ↳ `short_code` | string | Short code of the team | -| ↳ `image_path` | string | URL to the team logo | -| ↳ `founded` | number | Founding year of the team | -| ↳ `type` | string | Type of the team | -| ↳ `placeholder` | boolean | Whether the team is a placeholder | -| ↳ `last_played_at` | string | Date and time of the last played match | +| `brackets` | json | Bracket object containing stages \(fixtures grouped by knockout round\) and edges \(progression paths between fixtures\) | -### `sportmonks_football_get_team_squad` +### `sportmonks_football_get_coach` -Retrieve the current domestic squad for a team by team ID from Sportmonks +Retrieve a single football coach by their ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `teamId` | string | Yes | The unique id of the team | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;position\) | +| `coachId` | string | Yes | The unique id of the coach | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams;statistics\) | | `filters` | string | No | Filters to apply | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `squad` | array | Array of squad entries for the team | -| ↳ `id` | number | Unique id of the squad record | -| ↳ `transfer_id` | number | Transfer id of the squad record | -| ↳ `player_id` | number | Player in the squad | -| ↳ `team_id` | number | Team of the squad | -| ↳ `position_id` | number | Position of the player in the squad | -| ↳ `detailed_position_id` | number | Detailed position of the player in the squad | -| ↳ `jersey_number` | number | Jersey number of the player | -| ↳ `start` | string | Start contract date of the player | -| ↳ `end` | string | End contract date of the player | - -### `sportmonks_football_search_players` - -Search for football players by name from Sportmonks +| `coach` | object | The requested coach object | +| ↳ `id` | number | Unique id of the coach | +| ↳ `player_id` | number | Player related to the coach | +| ↳ `sport_id` | number | Sport of the coach | +| ↳ `country_id` | number | Country of the coach | +| ↳ `nationality_id` | number | Nationality of the coach | +| ↳ `city_id` | number | Birth city of the coach | +| ↳ `common_name` | string | Common name of the coach | +| ↳ `firstname` | string | First name of the coach | +| ↳ `lastname` | string | Last name of the coach | +| ↳ `name` | string | Name of the coach | +| ↳ `display_name` | string | Display name of the coach | +| ↳ `image_path` | string | URL to the coach headshot | +| ↳ `height` | number | Height of the coach in cm | +| ↳ `weight` | number | Weight of the coach in kg | +| ↳ `date_of_birth` | string | Date of birth of the coach | +| ↳ `gender` | string | Gender of the coach | + +### `sportmonks_football_get_coaches` + +Retrieve all football coaches available within your Sportmonks subscription #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The player name to search for \(e.g. Tavernier\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;position;teams.team\) | -| `filters` | string | No | Filters to apply | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply \(e.g. coachCountries:462\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order players by id \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `players` | array | Array of player objects matching the search query | -| ↳ `id` | number | Unique id of the player | -| ↳ `sport_id` | number | Sport of the player | -| ↳ `country_id` | number | Country of birth of the player | -| ↳ `nationality_id` | number | Nationality of the player | -| ↳ `city_id` | number | City of birth of the player | -| ↳ `position_id` | number | Position of the player | -| ↳ `detailed_position_id` | number | Detailed position of the player | -| ↳ `type_id` | number | Type of the player | -| ↳ `common_name` | string | Name the player is known for | -| ↳ `firstname` | string | First name of the player | -| ↳ `lastname` | string | Last name of the player | -| ↳ `name` | string | Name of the player | -| ↳ `display_name` | string | Display name of the player | -| ↳ `image_path` | string | URL to the player headshot | -| ↳ `height` | number | Height of the player in cm | -| ↳ `weight` | number | Weight of the player in kg | -| ↳ `date_of_birth` | string | Date of birth of the player | -| ↳ `gender` | string | Gender of the player | - -### `sportmonks_football_get_player` - -Retrieve a single football player by their ID from Sportmonks +| `coaches` | array | Array of coach objects | +| ↳ `id` | number | Unique id of the coach | +| ↳ `player_id` | number | Player related to the coach | +| ↳ `sport_id` | number | Sport of the coach | +| ↳ `country_id` | number | Country of the coach | +| ↳ `nationality_id` | number | Nationality of the coach | +| ↳ `city_id` | number | Birth city of the coach | +| ↳ `common_name` | string | Common name of the coach | +| ↳ `firstname` | string | First name of the coach | +| ↳ `lastname` | string | Last name of the coach | +| ↳ `name` | string | Name of the coach | +| ↳ `display_name` | string | Display name of the coach | +| ↳ `image_path` | string | URL to the coach headshot | +| ↳ `height` | number | Height of the coach in cm | +| ↳ `weight` | number | Weight of the coach in kg | +| ↳ `date_of_birth` | string | Date of birth of the coach | +| ↳ `gender` | string | Gender of the coach | + +### `sportmonks_football_get_coaches_by_country` + +Retrieve all coaches for a country ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `playerId` | string | Yes | The unique id of the player | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;position;teams.team;statistics\) | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;nationality\) | | `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `player` | object | The requested player object | -| ↳ `id` | number | Unique id of the player | -| ↳ `sport_id` | number | Sport of the player | -| ↳ `country_id` | number | Country of birth of the player | -| ↳ `nationality_id` | number | Nationality of the player | -| ↳ `city_id` | number | City of birth of the player | -| ↳ `position_id` | number | Position of the player | -| ↳ `detailed_position_id` | number | Detailed position of the player | -| ↳ `type_id` | number | Type of the player | -| ↳ `common_name` | string | Name the player is known for | -| ↳ `firstname` | string | First name of the player | -| ↳ `lastname` | string | Last name of the player | -| ↳ `name` | string | Name of the player | -| ↳ `display_name` | string | Display name of the player | -| ↳ `image_path` | string | URL to the player headshot | -| ↳ `height` | number | Height of the player in cm | -| ↳ `weight` | number | Weight of the player in kg | -| ↳ `date_of_birth` | string | Date of birth of the player | -| ↳ `gender` | string | Gender of the player | - -### `sportmonks_football_get_standings_by_season` - -Retrieve the full league standings table for a season by season ID from Sportmonks +| `coaches` | array | Array of coach objects for the country | +| ↳ `id` | number | Unique id of the coach | +| ↳ `player_id` | number | Player related to the coach | +| ↳ `sport_id` | number | Sport of the coach | +| ↳ `country_id` | number | Country of the coach | +| ↳ `nationality_id` | number | Nationality of the coach | +| ↳ `city_id` | number | Birth city of the coach | +| ↳ `common_name` | string | Common name of the coach | +| ↳ `firstname` | string | First name of the coach | +| ↳ `lastname` | string | Last name of the coach | +| ↳ `name` | string | Name of the coach | +| ↳ `display_name` | string | Display name of the coach | +| ↳ `image_path` | string | URL to the coach headshot | +| ↳ `height` | number | Height of the coach in cm | +| ↳ `weight` | number | Weight of the coach in kg | +| ↳ `date_of_birth` | string | Date of birth of the coach | +| ↳ `gender` | string | Gender of the coach | + +### `sportmonks_football_get_commentaries_by_fixture` + +Retrieve textual commentary for a fixture by fixture ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `seasonId` | string | Yes | The unique id of the season | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details;form\) | -| `filters` | string | No | Filters to apply \(e.g. standingStages:77453568\) | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;relatedPlayer\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `standings` | array | Array of standing entries for the season | -| ↳ `id` | number | Unique id of the standing | -| ↳ `participant_id` | number | Team related to the standing | -| ↳ `sport_id` | number | Sport related to the standing | -| ↳ `league_id` | number | League related to the standing | -| ↳ `season_id` | number | Season related to the standing | -| ↳ `stage_id` | number | Stage related to the standing | -| ↳ `group_id` | number | Group related to the standing | -| ↳ `round_id` | number | Round related to the standing | -| ↳ `standing_rule_id` | number | Standing rule related to the standing | -| ↳ `position` | number | Position of the team in the standing | -| ↳ `result` | string | Movement of the team in the standing | -| ↳ `points` | number | Points the team has gathered | +| `commentaries` | array | Array of commentary entries for the fixture | +| ↳ `id` | number | Unique id of the commentary | +| ↳ `fixture_id` | number | Fixture related to the commentary | +| ↳ `comment` | string | The commentary text | +| ↳ `minute` | number | Match minute of the comment | +| ↳ `extra_minute` | number | Extra \(injury\) minute of the comment | +| ↳ `is_goal` | boolean | Whether the comment is a goal | +| ↳ `is_important` | boolean | Whether the comment is important | +| ↳ `order` | number | Order of the comment | -### `sportmonks_football_get_topscorers_by_season` +### `sportmonks_football_get_current_leagues_by_team` -Retrieve the topscorers (goals, assists, cards) for a season by season ID from Sportmonks +Retrieve all current leagues for a team ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `seasonId` | string | Yes | The unique id of the season | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;participant;type\) | -| `filters` | string | No | Filters to apply \(e.g. seasontopscorerTypes:208\) | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order topscorers by position \(asc or desc\) | +| `order` | string | No | Order leagues \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `topscorers` | array | Array of topscorer entries for the season | -| ↳ `id` | number | Unique id of the topscorer record | -| ↳ `season_id` | number | Season related to the topscorer | -| ↳ `league_id` | number | League related to the topscorer | -| ↳ `stage_id` | number | Stage related to the topscorer | -| ↳ `player_id` | number | Player related to the topscorer | -| ↳ `participant_id` | number | Team related to the topscorer | -| ↳ `type_id` | number | Type of the topscorer \(goals, assists, cards\) | -| ↳ `position` | number | Position of the topscorer | -| ↳ `total` | number | Number of goals, assists or cards | +| `leagues` | array | Array of current league objects for the team | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | -### `sportmonks_motorsport_get_livescores` +### `sportmonks_football_get_expected_lineups_by_player` -Retrieve all live motorsport fixtures (sessions) from Sportmonks +Retrieve the premium expected lineups for a player ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results\) | +| `playerId` | string | Yes | The unique id of the player | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fixture\) | | `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | @@ -574,150 +516,3468 @@ Retrieve all live motorsport fixtures (sessions) from Sportmonks | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of live motorsport fixture \(session\) objects | -| ↳ `id` | number | Unique id of the fixture \(session\) | -| ↳ `sport_id` | number | Sport of the fixture | -| ↳ `league_id` | number | League the fixture is held in | -| ↳ `season_id` | number | Season the fixture is held in | -| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | -| ↳ `group_id` | number | Not used in the Motorsport API | -| ↳ `aggregate_id` | number | Not used in the Motorsport API | -| ↳ `round_id` | number | Not used in the Motorsport API | -| ↳ `state_id` | number | State the fixture is currently in | -| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | -| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | -| ↳ `starting_at` | string | Start date and time | -| ↳ `result_info` | string | Final result info | -| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Session length in minutes or total laps | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Not used in the Motorsport API | -| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `expectedLineups` | array | Array of expected lineup entries for the player | +| ↳ `id` | number | Unique id of the expected lineup record | +| ↳ `sport_id` | number | Sport of the expected lineup | +| ↳ `fixture_id` | number | Fixture the expected lineup relates to | +| ↳ `player_id` | number | Player in the expected lineup | +| ↳ `team_id` | number | Team of the expected lineup player | +| ↳ `formation_field` | string | Formation field of the player | +| ↳ `position_id` | number | Position id of the player | +| ↳ `detailed_position_id` | number | Detailed position id of the player | +| ↳ `type_id` | number | Type of the expected lineup record | +| ↳ `formation_position` | number | Position of the player in the formation | +| ↳ `player_name` | string | Name of the player | +| ↳ `jersey_number` | number | Jersey number of the player | -### `sportmonks_motorsport_get_fixtures_by_date` +### `sportmonks_football_get_expected_lineups_by_team` -Retrieve motorsport fixtures (sessions) on a specific date (YYYY-MM-DD) from Sportmonks +Retrieve the premium expected lineups for a team ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `date` | string | Yes | The date to fetch fixtures for, in YYYY-MM-DD format | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;venue\) | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fixture\) | | `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | -| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixtures` | array | Array of motorsport fixture \(session\) objects for the requested date | -| ↳ `id` | number | Unique id of the fixture \(session\) | -| ↳ `sport_id` | number | Sport of the fixture | -| ↳ `league_id` | number | League the fixture is held in | -| ↳ `season_id` | number | Season the fixture is held in | -| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | -| ↳ `group_id` | number | Not used in the Motorsport API | -| ↳ `aggregate_id` | number | Not used in the Motorsport API | -| ↳ `round_id` | number | Not used in the Motorsport API | -| ↳ `state_id` | number | State the fixture is currently in | -| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | -| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | -| ↳ `starting_at` | string | Start date and time | -| ↳ `result_info` | string | Final result info | -| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Session length in minutes or total laps | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Not used in the Motorsport API | -| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `expectedLineups` | array | Array of expected lineup entries for the team | +| ↳ `id` | number | Unique id of the expected lineup record | +| ↳ `sport_id` | number | Sport of the expected lineup | +| ↳ `fixture_id` | number | Fixture the expected lineup relates to | +| ↳ `player_id` | number | Player in the expected lineup | +| ↳ `team_id` | number | Team of the expected lineup player | +| ↳ `formation_field` | string | Formation field of the player | +| ↳ `position_id` | number | Position id of the player | +| ↳ `detailed_position_id` | number | Detailed position id of the player | +| ↳ `type_id` | number | Type of the expected lineup record | +| ↳ `formation_position` | number | Position of the player in the formation | +| ↳ `player_name` | string | Name of the player | +| ↳ `jersey_number` | number | Jersey number of the player | -### `sportmonks_motorsport_get_fixture` +### `sportmonks_football_get_extended_team_squad` -Retrieve a single motorsport fixture (session) by its ID from Sportmonks +Retrieve all squad entries for a team (based on current seasons) by team ID #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results;latestLaps;pitstops\) | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;position\) | | `filters` | string | No | Filters to apply | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `fixture` | object | The requested motorsport fixture \(session\) object | -| ↳ `id` | number | Unique id of the fixture \(session\) | -| ↳ `sport_id` | number | Sport of the fixture | -| ↳ `league_id` | number | League the fixture is held in | -| ↳ `season_id` | number | Season the fixture is held in | -| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | -| ↳ `group_id` | number | Not used in the Motorsport API | -| ↳ `aggregate_id` | number | Not used in the Motorsport API | -| ↳ `round_id` | number | Not used in the Motorsport API | -| ↳ `state_id` | number | State the fixture is currently in | -| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | -| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | -| ↳ `starting_at` | string | Start date and time | -| ↳ `result_info` | string | Final result info | -| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | -| ↳ `details` | string | Details about the fixture | -| ↳ `length` | number | Session length in minutes or total laps | -| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | -| ↳ `has_odds` | boolean | Not used in the Motorsport API | -| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | -| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | +| `squad` | array | Array of extended squad entries for the team | +| ↳ `id` | number | Unique id of the squad record | +| ↳ `transfer_id` | number | Transfer id of the squad record | +| ↳ `player_id` | number | Player in the squad | +| ↳ `team_id` | number | Team of the squad | +| ↳ `position_id` | number | Position of the player in the squad | +| ↳ `detailed_position_id` | number | Detailed position of the player in the squad | +| ↳ `jersey_number` | number | Jersey number of the player | +| ↳ `start` | string | Start contract date of the player | +| ↳ `end` | string | End contract date of the player | -### `sportmonks_motorsport_get_drivers` +### `sportmonks_football_get_fixture` -Retrieve all motorsport drivers from Sportmonks +Retrieve a single football fixture by its ID from Sportmonks #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | -| `filters` | string | No | Filters to apply | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events;lineups;statistics\) | +| `filters` | string | No | Filters to apply \(e.g. eventTypes:14\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `drivers` | array | Array of driver objects | -| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | -| ↳ `sport_id` | number | Sport of the driver | -| ↳ `country_id` | number | Country of birth of the driver | -| ↳ `nationality_id` | number | Nationality of the driver | -| ↳ `city_id` | number | City of birth of the driver | -| ↳ `position_id` | number | Position of the driver within the team | -| ↳ `detailed_position_id` | number | Not used in the Motorsport API | -| ↳ `type_id` | number | Not used in the Motorsport API | -| ↳ `common_name` | string | Name the driver is known for | -| ↳ `firstname` | string | First name of the driver | -| ↳ `lastname` | string | Last name of the driver | -| ↳ `name` | string | Name of the driver | -| ↳ `display_name` | string | Display name of the driver | -| ↳ `image_path` | string | URL to the driver headshot | -| ↳ `height` | number | Height of the driver in cm | -| ↳ `weight` | number | Weight of the driver in kg | -| ↳ `date_of_birth` | string | Date of birth of the driver | -| ↳ `gender` | string | Gender of the driver | - -### `sportmonks_motorsport_get_driver` - +| `fixture` | object | The requested fixture object | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_fixtures_by_date` + +Retrieve all football fixtures on a specific date (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `date` | string | Yes | The date to fetch fixtures for, in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;league\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501,271\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of fixture objects for the requested date | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_fixtures_by_date_range` + +Retrieve football fixtures between two dates (YYYY-MM-DD) from Sportmonks. Max range is 100 days. + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format | +| `endDate` | string | Yes | End date in YYYY-MM-DD format \(max 100 days after start\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501,271\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of fixture objects within the requested date range | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_fixtures_by_date_range_for_team` + +Retrieve fixtures for a team within a date range (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format | +| `endDate` | string | Yes | End date in YYYY-MM-DD format | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of fixture objects for the team within the date range | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_fixtures_by_ids` + +Retrieve multiple football fixtures by a comma-separated list of IDs (max 50) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `ids` | string | Yes | Comma-separated fixture IDs \(e.g. 18535517,18535518\). Maximum of 50 IDs | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of fixture objects for the requested IDs | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_grouped_standings_by_round` + +Retrieve the standing table for a round ID grouped by group where applicable from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `roundId` | string | Yes | The unique id of the round | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply \(e.g. standingGroups:246697\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | json | Standings for the round: an array of groups \(each with id, name and a standings array\) when groups exist, otherwise a flat array of standing entries | + +### `sportmonks_football_get_head_to_head` + +Retrieve the head-to-head fixtures between two teams from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `team1` | string | Yes | The id of the first team | +| `team2` | string | Yes | The id of the second team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of head-to-head fixture objects between the two teams | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_inplay_livescores` + +Retrieve all fixtures that are currently being played (in-play) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of in-play fixture objects | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_latest_coaches` + +Retrieve all coaches that have received updates in the past two hours + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;nationality\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `coaches` | array | Array of recently updated coach objects | +| ↳ `id` | number | Unique id of the coach | +| ↳ `player_id` | number | Player related to the coach | +| ↳ `sport_id` | number | Sport of the coach | +| ↳ `country_id` | number | Country of the coach | +| ↳ `nationality_id` | number | Nationality of the coach | +| ↳ `city_id` | number | Birth city of the coach | +| ↳ `common_name` | string | Common name of the coach | +| ↳ `firstname` | string | First name of the coach | +| ↳ `lastname` | string | Last name of the coach | +| ↳ `name` | string | Name of the coach | +| ↳ `display_name` | string | Display name of the coach | +| ↳ `image_path` | string | URL to the coach headshot | +| ↳ `height` | number | Height of the coach in cm | +| ↳ `weight` | number | Weight of the coach in kg | +| ↳ `date_of_birth` | string | Date of birth of the coach | +| ↳ `gender` | string | Gender of the coach | + +### `sportmonks_football_get_latest_fixtures` + +Retrieve all fixtures that have received updates within the last 10 seconds + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of recently updated fixture objects | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_latest_livescores` + +Retrieve all livescores that have received updates within the last 10 seconds + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of recently updated live fixture objects | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_latest_players` + +Retrieve all players that have received updates in the past two hours + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. nationality;position\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `players` | array | Array of recently updated player objects | +| ↳ `id` | number | Unique id of the player | +| ↳ `sport_id` | number | Sport of the player | +| ↳ `country_id` | number | Country of birth of the player | +| ↳ `nationality_id` | number | Nationality of the player | +| ↳ `city_id` | number | City of birth of the player | +| ↳ `position_id` | number | Position of the player | +| ↳ `detailed_position_id` | number | Detailed position of the player | +| ↳ `type_id` | number | Type of the player | +| ↳ `common_name` | string | Name the player is known for | +| ↳ `firstname` | string | First name of the player | +| ↳ `lastname` | string | Last name of the player | +| ↳ `name` | string | Name of the player | +| ↳ `display_name` | string | Display name of the player | +| ↳ `image_path` | string | URL to the player headshot | +| ↳ `height` | number | Height of the player in cm | +| ↳ `weight` | number | Weight of the player in kg | +| ↳ `date_of_birth` | string | Date of birth of the player | +| ↳ `gender` | string | Gender of the player | + +### `sportmonks_football_get_latest_totw` + +Retrieve the latest Team of the Week (TOTW) for a league ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;team;player;round\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `totw` | array | Array of the latest Team of the Week entries for the league | +| ↳ `id` | number | Unique id of the TOTW entry | +| ↳ `player_id` | number | Player of the team of the week | +| ↳ `fixture_id` | number | Fixture the TOTW player played in | +| ↳ `round_id` | number | Round the fixture is played at | +| ↳ `team_id` | number | Team the TOTW player played for | +| ↳ `rating` | string | Rating of the TOTW player | +| ↳ `formation_position` | number | Player position in the TOTW formation | +| ↳ `formation` | string | The TOTW's formation | + +### `sportmonks_football_get_latest_transfers` + +Retrieve the latest transfers available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply \(e.g. transferTypes:219,220\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transfers` | array | Array of the latest transfer objects | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_league` + +Retrieve a single football league by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason;seasons\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `league` | object | The requested league object | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_leagues` + +Retrieve all football leagues available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_leagues_by_country` + +Retrieve all leagues for a country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects for the country | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_leagues_by_date` + +Retrieve all leagues with fixtures on a given date (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `date` | string | Yes | The fixture date in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects with fixtures on the requested date | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_leagues_by_team` + +Retrieve all current and historical leagues for a team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of current and historical league objects for the team | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_live_leagues` + +Retrieve all leagues that have fixtures currently being played from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of currently live league objects | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_get_live_probabilities` + +Retrieve all live (in-play) prediction probabilities from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `predictions` | array | Array of live probability prediction objects | +| ↳ `id` | number | Unique id of the live prediction record | +| ↳ `fixture_id` | number | Fixture the prediction belongs to | +| ↳ `period_id` | number | Match period the prediction was recorded in | +| ↳ `minute` | number | Match minute the prediction was generated | +| ↳ `predictions` | json | Home win, away win and draw probabilities as percentages | +| ↳ `type_id` | number | Type of the prediction \(237 for fulltime result\) | + +### `sportmonks_football_get_live_probabilities_by_fixture` + +Retrieve all live (in-play) prediction probabilities for a fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `predictions` | array | Array of live probability prediction objects for the fixture | +| ↳ `id` | number | Unique id of the live prediction record | +| ↳ `fixture_id` | number | Fixture the prediction belongs to | +| ↳ `period_id` | number | Match period the prediction was recorded in | +| ↳ `minute` | number | Match minute the prediction was generated | +| ↳ `predictions` | json | Home win, away win and draw probabilities as percentages | +| ↳ `type_id` | number | Type of the prediction \(237 for fulltime result\) | + +### `sportmonks_football_get_live_standings_by_league` + +Retrieve the live standing table for a league ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply \(e.g. standingGroups:246697\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of live standing entries for the league | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Group related to the standing | +| ↳ `round_id` | number | Round related to the standing | +| ↳ `standing_rule_id` | number | Standing rule related to the standing | +| ↳ `position` | number | Position of the team in the standing | +| ↳ `result` | string | Movement of the team in the standing | +| ↳ `points` | number | Points the team has gathered | + +### `sportmonks_football_get_livescores` + +Retrieve fixtures starting within 15 minutes and currently in progress from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores;events\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of live fixture objects | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_match_facts` + +Retrieve all available match facts within your Sportmonks subscription (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;sport;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. matchFactTypes:76088\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `matchFacts` | array | Array of match fact objects | +| ↳ `id` | number | Unique id of the match fact | +| ↳ `sport_id` | number | Sport of the match fact | +| ↳ `fixture_id` | number | Fixture related to the match fact | +| ↳ `type_id` | number | Type of the match fact | +| ↳ `participant` | string | Team the fact relates to \(home or away\) | +| ↳ `basis` | string | Basis of the match fact \(e.g. h2h, overall\) | +| ↳ `data` | json | Match fact data payload \(counts and percentages\) | +| ↳ `natural_language` | string | Human-readable description of the match fact | +| ↳ `category` | string | Category of the match fact | +| ↳ `scope` | string | Scope of the match fact | + +### `sportmonks_football_get_match_facts_by_date_range` + +Retrieve match facts within a date range (YYYY-MM-DD) from Sportmonks (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format | +| `endDate` | string | Yes | End date in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;sport;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. matchFactTypes:76088\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `matchFacts` | array | Array of match fact objects within the date range | +| ↳ `id` | number | Unique id of the match fact | +| ↳ `sport_id` | number | Sport of the match fact | +| ↳ `fixture_id` | number | Fixture related to the match fact | +| ↳ `type_id` | number | Type of the match fact | +| ↳ `participant` | string | Team the fact relates to \(home or away\) | +| ↳ `basis` | string | Basis of the match fact \(e.g. h2h, overall\) | +| ↳ `data` | json | Match fact data payload \(counts and percentages\) | +| ↳ `natural_language` | string | Human-readable description of the match fact | +| ↳ `category` | string | Category of the match fact | +| ↳ `scope` | string | Scope of the match fact | + +### `sportmonks_football_get_match_facts_by_fixture` + +Retrieve match facts for a fixture ID from Sportmonks (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;sport;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. matchFactTypes:76088\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `matchFacts` | array | Array of match fact objects for the fixture | +| ↳ `id` | number | Unique id of the match fact | +| ↳ `sport_id` | number | Sport of the match fact | +| ↳ `fixture_id` | number | Fixture related to the match fact | +| ↳ `type_id` | number | Type of the match fact | +| ↳ `participant` | string | Team the fact relates to \(home or away\) | +| ↳ `basis` | string | Basis of the match fact \(e.g. h2h, overall\) | +| ↳ `data` | json | Match fact data payload \(counts and percentages\) | +| ↳ `natural_language` | string | Human-readable description of the match fact | +| ↳ `category` | string | Category of the match fact | +| ↳ `scope` | string | Scope of the match fact | + +### `sportmonks_football_get_match_facts_by_league` + +Retrieve match facts for a league ID from Sportmonks (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;sport;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. matchFactTypes:76088\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `matchFacts` | array | Array of match fact objects for the league | +| ↳ `id` | number | Unique id of the match fact | +| ↳ `sport_id` | number | Sport of the match fact | +| ↳ `fixture_id` | number | Fixture related to the match fact | +| ↳ `type_id` | number | Type of the match fact | +| ↳ `participant` | string | Team the fact relates to \(home or away\) | +| ↳ `basis` | string | Basis of the match fact \(e.g. h2h, overall\) | +| ↳ `data` | json | Match fact data payload \(counts and percentages\) | +| ↳ `natural_language` | string | Human-readable description of the match fact | +| ↳ `category` | string | Category of the match fact | +| ↳ `scope` | string | Scope of the match fact | + +### `sportmonks_football_get_past_fixtures_by_tv_station` + +Retrieve all past fixtures that were available for a TV station ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `tvStationId` | string | Yes | The unique id of the TV station | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of past fixture objects for the TV station | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_player` + +Retrieve a single football player by their ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `playerId` | string | Yes | The unique id of the player | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;position;teams.team;statistics\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `player` | object | The requested player object | +| ↳ `id` | number | Unique id of the player | +| ↳ `sport_id` | number | Sport of the player | +| ↳ `country_id` | number | Country of birth of the player | +| ↳ `nationality_id` | number | Nationality of the player | +| ↳ `city_id` | number | City of birth of the player | +| ↳ `position_id` | number | Position of the player | +| ↳ `detailed_position_id` | number | Detailed position of the player | +| ↳ `type_id` | number | Type of the player | +| ↳ `common_name` | string | Name the player is known for | +| ↳ `firstname` | string | First name of the player | +| ↳ `lastname` | string | Last name of the player | +| ↳ `name` | string | Name of the player | +| ↳ `display_name` | string | Display name of the player | +| ↳ `image_path` | string | URL to the player headshot | +| ↳ `height` | number | Height of the player in cm | +| ↳ `weight` | number | Weight of the player in kg | +| ↳ `date_of_birth` | string | Date of birth of the player | +| ↳ `gender` | string | Gender of the player | + +### `sportmonks_football_get_players_by_country` + +Retrieve all players for a country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. nationality;position\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order players by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `players` | array | Array of player objects for the country | +| ↳ `id` | number | Unique id of the player | +| ↳ `sport_id` | number | Sport of the player | +| ↳ `country_id` | number | Country of birth of the player | +| ↳ `nationality_id` | number | Nationality of the player | +| ↳ `city_id` | number | City of birth of the player | +| ↳ `position_id` | number | Position of the player | +| ↳ `detailed_position_id` | number | Detailed position of the player | +| ↳ `type_id` | number | Type of the player | +| ↳ `common_name` | string | Name the player is known for | +| ↳ `firstname` | string | First name of the player | +| ↳ `lastname` | string | Last name of the player | +| ↳ `name` | string | Name of the player | +| ↳ `display_name` | string | Display name of the player | +| ↳ `image_path` | string | URL to the player headshot | +| ↳ `height` | number | Height of the player in cm | +| ↳ `weight` | number | Weight of the player in kg | +| ↳ `date_of_birth` | string | Date of birth of the player | +| ↳ `gender` | string | Gender of the player | + +### `sportmonks_football_get_postmatch_news` + +Retrieve all post-match news articles available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;league\) | +| `filters` | string | No | Filters to apply \(e.g. newsitemLeagues:8\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order news by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `news` | array | Array of post-match news articles | +| ↳ `id` | number | Unique id of the news article | +| ↳ `fixture_id` | number | Fixture related to the news article | +| ↳ `league_id` | number | League related to the news article | +| ↳ `title` | string | Title of the news article | +| ↳ `type` | string | Type of the news \(prematch or postmatch\) | + +### `sportmonks_football_get_postmatch_news_by_season` + +Retrieve all post-match news articles for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;league\) | +| `filters` | string | No | Filters to apply \(e.g. newsitemLeagues:8\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order news \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `news` | array | Array of post-match news articles for the season | +| ↳ `id` | number | Unique id of the news article | +| ↳ `fixture_id` | number | Fixture related to the news article | +| ↳ `league_id` | number | League related to the news article | +| ↳ `title` | string | Title of the news article | +| ↳ `type` | string | Type of the news \(prematch or postmatch\) | + +### `sportmonks_football_get_predictability_by_league` + +Retrieve the predictions model performance for a league ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;league\) | +| `filters` | string | No | Filters to apply \(e.g. predictabilityTypes:245\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `predictability` | array | Array of predictability records for the league | +| ↳ `id` | number | Unique id of the predictability record | +| ↳ `league_id` | number | League related to the predictability | +| ↳ `type_id` | number | Type of the predictability | +| ↳ `data` | json | Predictability values per market | + +### `sportmonks_football_get_prematch_news` + +Retrieve all pre-match news articles available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;league\) | +| `filters` | string | No | Filters to apply \(e.g. newsitemLeagues:8\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order news by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `news` | array | Array of pre-match news articles | +| ↳ `id` | number | Unique id of the news article | +| ↳ `fixture_id` | number | Fixture related to the news article | +| ↳ `league_id` | number | League related to the news article | +| ↳ `title` | string | Title of the news article | +| ↳ `type` | string | Type of the news \(prematch or postmatch\) | + +### `sportmonks_football_get_prematch_news_by_season` + +Retrieve all pre-match news articles for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;league\) | +| `filters` | string | No | Filters to apply \(e.g. newsitemLeagues:8\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order news \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `news` | array | Array of pre-match news articles for the season | +| ↳ `id` | number | Unique id of the news article | +| ↳ `fixture_id` | number | Fixture related to the news article | +| ↳ `league_id` | number | League related to the news article | +| ↳ `title` | string | Title of the news article | +| ↳ `type` | string | Type of the news \(prematch or postmatch\) | + +### `sportmonks_football_get_prematch_news_upcoming` + +Retrieve all pre-match news articles for upcoming fixtures from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;league\) | +| `filters` | string | No | Filters to apply \(e.g. newsitemLeagues:8\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order news \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `news` | array | Array of pre-match news articles for upcoming fixtures | +| ↳ `id` | number | Unique id of the news article | +| ↳ `fixture_id` | number | Fixture related to the news article | +| ↳ `league_id` | number | League related to the news article | +| ↳ `title` | string | Title of the news article | +| ↳ `type` | string | Type of the news \(prematch or postmatch\) | + +### `sportmonks_football_get_probabilities` + +Retrieve all prediction probabilities available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. predictionTypes:236\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `predictions` | array | Array of prediction probability objects | +| ↳ `id` | number | Unique id of the prediction | +| ↳ `fixture_id` | number | Fixture related to the prediction | +| ↳ `predictions` | json | Prediction payload \(varies by type: score map, value bet object, etc.\) | +| ↳ `type_id` | number | Type of the prediction | + +### `sportmonks_football_get_probabilities_by_fixture` + +Retrieve prediction probabilities for a fixture by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `filters` | string | No | Filters to apply \(e.g. predictionTypes:236\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `predictions` | array | Array of prediction probability entries for the fixture | +| ↳ `id` | number | Unique id of the prediction | +| ↳ `fixture_id` | number | Fixture related to the prediction | +| ↳ `predictions` | json | Prediction payload \(varies by type: score map, value bet object, etc.\) | +| ↳ `type_id` | number | Type of the prediction | + +### `sportmonks_football_get_referee` + +Retrieve a single football referee by their ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `refereeId` | string | Yes | The unique id of the referee | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;statistics\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `referee` | object | The requested referee object | +| ↳ `id` | number | Unique id of the referee | +| ↳ `sport_id` | number | Sport of the referee | +| ↳ `country_id` | number | Country of the referee | +| ↳ `nationality_id` | number | Nationality of the referee | +| ↳ `city_id` | number | Birth city of the referee | +| ↳ `common_name` | string | Common name of the referee | +| ↳ `firstname` | string | First name of the referee | +| ↳ `lastname` | string | Last name of the referee | +| ↳ `name` | string | Name of the referee | +| ↳ `display_name` | string | Display name of the referee | +| ↳ `image_path` | string | URL to the referee headshot | +| ↳ `height` | number | Height of the referee in cm | +| ↳ `weight` | number | Weight of the referee in kg | +| ↳ `date_of_birth` | string | Date of birth of the referee | +| ↳ `gender` | string | Gender of the referee | + +### `sportmonks_football_get_referees` + +Retrieve all football referees available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;statistics\) | +| `filters` | string | No | Filters to apply \(e.g. refereeCountries:44\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `referees` | array | Array of referee objects | +| ↳ `id` | number | Unique id of the referee | +| ↳ `sport_id` | number | Sport of the referee | +| ↳ `country_id` | number | Country of the referee | +| ↳ `nationality_id` | number | Nationality of the referee | +| ↳ `city_id` | number | Birth city of the referee | +| ↳ `common_name` | string | Common name of the referee | +| ↳ `firstname` | string | First name of the referee | +| ↳ `lastname` | string | Last name of the referee | +| ↳ `name` | string | Name of the referee | +| ↳ `display_name` | string | Display name of the referee | +| ↳ `image_path` | string | URL to the referee headshot | +| ↳ `height` | number | Height of the referee in cm | +| ↳ `weight` | number | Weight of the referee in kg | +| ↳ `date_of_birth` | string | Date of birth of the referee | +| ↳ `gender` | string | Gender of the referee | + +### `sportmonks_football_get_referees_by_country` + +Retrieve all referees for a country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;nationality\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `referees` | array | Array of referee objects for the country | +| ↳ `id` | number | Unique id of the referee | +| ↳ `sport_id` | number | Sport of the referee | +| ↳ `country_id` | number | Country of the referee | +| ↳ `nationality_id` | number | Nationality of the referee | +| ↳ `city_id` | number | Birth city of the referee | +| ↳ `common_name` | string | Common name of the referee | +| ↳ `firstname` | string | First name of the referee | +| ↳ `lastname` | string | Last name of the referee | +| ↳ `name` | string | Name of the referee | +| ↳ `display_name` | string | Display name of the referee | +| ↳ `image_path` | string | URL to the referee headshot | +| ↳ `height` | number | Height of the referee in cm | +| ↳ `weight` | number | Weight of the referee in kg | +| ↳ `date_of_birth` | string | Date of birth of the referee | +| ↳ `gender` | string | Gender of the referee | + +### `sportmonks_football_get_referees_by_season` + +Retrieve all referees for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;nationality\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `referees` | array | Array of referee objects for the season | +| ↳ `id` | number | Unique id of the referee | +| ↳ `sport_id` | number | Sport of the referee | +| ↳ `country_id` | number | Country of the referee | +| ↳ `nationality_id` | number | Nationality of the referee | +| ↳ `city_id` | number | Birth city of the referee | +| ↳ `common_name` | string | Common name of the referee | +| ↳ `firstname` | string | First name of the referee | +| ↳ `lastname` | string | Last name of the referee | +| ↳ `name` | string | Name of the referee | +| ↳ `display_name` | string | Display name of the referee | +| ↳ `image_path` | string | URL to the referee headshot | +| ↳ `height` | number | Height of the referee in cm | +| ↳ `weight` | number | Weight of the referee in kg | +| ↳ `date_of_birth` | string | Date of birth of the referee | +| ↳ `gender` | string | Gender of the referee | + +### `sportmonks_football_get_rivals_by_team` + +Retrieve rival teams for a team by team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. team;rival\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `rivals` | array | Array of rival relationships for the team | +| ↳ `sport_id` | number | Sport of the rival | +| ↳ `team_id` | number | Team the rivalry belongs to | +| ↳ `rival_id` | number | Rival team id | + +### `sportmonks_football_get_round` + +Retrieve a single football round by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `roundId` | string | Yes | The unique id of the round | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;stage;fixtures\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `round` | object | The requested round object | +| ↳ `id` | number | Unique id of the round | +| ↳ `sport_id` | number | Sport of the round | +| ↳ `league_id` | number | League of the round | +| ↳ `season_id` | number | Season of the round | +| ↳ `stage_id` | number | Stage of the round | +| ↳ `name` | string | Name of the round | +| ↳ `finished` | boolean | Whether the round is finished | +| ↳ `is_current` | boolean | Whether the round is the current round | +| ↳ `starting_at` | string | Start date of the round | +| ↳ `ending_at` | string | End date of the round | +| ↳ `games_in_current_week` | boolean | Whether the round has fixtures this week | + +### `sportmonks_football_get_round_statistics` + +Retrieve all available statistics for a round ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `roundId` | string | Yes | The unique id of the round | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant\) | +| `filters` | string | No | Filters to apply \(e.g. seasonstatisticTypes:52,88\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `statistics` | array | Array of statistic entries for the round | +| ↳ `id` | number | Unique id of the statistic record | +| ↳ `model_id` | number | Id of the entity the statistic belongs to | +| ↳ `type_id` | number | Type of the statistic | +| ↳ `relation_id` | number | Related entity id \(e.g. participant\) when applicable | +| ↳ `value` | json | Statistic value payload \(varies by type\) | + +### `sportmonks_football_get_rounds` + +Retrieve all football rounds available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;stage\) | +| `filters` | string | No | Filters to apply \(e.g. roundSeasons:19735\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `rounds` | array | Array of round objects | +| ↳ `id` | number | Unique id of the round | +| ↳ `sport_id` | number | Sport of the round | +| ↳ `league_id` | number | League of the round | +| ↳ `season_id` | number | Season of the round | +| ↳ `stage_id` | number | Stage of the round | +| ↳ `name` | string | Name of the round | +| ↳ `finished` | boolean | Whether the round is finished | +| ↳ `is_current` | boolean | Whether the round is the current round | +| ↳ `starting_at` | string | Start date of the round | +| ↳ `ending_at` | string | End date of the round | +| ↳ `games_in_current_week` | boolean | Whether the round has fixtures this week | + +### `sportmonks_football_get_rounds_by_season` + +Retrieve all rounds for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stage\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `rounds` | array | Array of round objects for the season | +| ↳ `id` | number | Unique id of the round | +| ↳ `sport_id` | number | Sport of the round | +| ↳ `league_id` | number | League of the round | +| ↳ `season_id` | number | Season of the round | +| ↳ `stage_id` | number | Stage of the round | +| ↳ `name` | string | Name of the round | +| ↳ `finished` | boolean | Whether the round is finished | +| ↳ `is_current` | boolean | Whether the round is the current round | +| ↳ `starting_at` | string | Start date of the round | +| ↳ `ending_at` | string | End date of the round | +| ↳ `games_in_current_week` | boolean | Whether the round has fixtures this week | + +### `sportmonks_football_get_schedules_by_season` + +Retrieve the full schedule (stages, rounds and fixtures) for a season by season ID + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `schedules` | json | Array of stages, each with nested rounds and their fixtures \(participants, scores\) | + +### `sportmonks_football_get_schedules_by_season_and_team` + +Retrieve the full season schedule for a specific team by season ID and team ID + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `teamId` | string | Yes | The unique id of the team | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `schedules` | json | Array of stages, each with nested rounds and their fixtures for the team in the season | + +### `sportmonks_football_get_schedules_by_team` + +Retrieve the full schedule (stages, rounds and fixtures) for a team by team ID + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `schedules` | json | Array of stages, each with nested rounds and their fixtures \(participants, scores\) | + +### `sportmonks_football_get_season` + +Retrieve a single football season by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stages;fixtures\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `season` | object | The requested season object | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Tie-breaker rule of the season | +| ↳ `name` | string | Name of the season \(e.g. 2023/2024\) | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `standing_method` | string | Standing calculation method | +| ↳ `starting_at` | string | Start date of the season | +| ↳ `ending_at` | string | End date of the season | +| ↳ `standings_recalculated_at` | string | Last standings recalculation time | +| ↳ `games_in_current_week` | boolean | Whether the season has fixtures this week | + +### `sportmonks_football_get_seasons` + +Retrieve all football seasons available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stages\) | +| `filters` | string | No | Filters to apply \(e.g. seasonLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `seasons` | array | Array of season objects | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Tie-breaker rule of the season | +| ↳ `name` | string | Name of the season \(e.g. 2023/2024\) | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `standing_method` | string | Standing calculation method | +| ↳ `starting_at` | string | Start date of the season | +| ↳ `ending_at` | string | End date of the season | +| ↳ `standings_recalculated_at` | string | Last standings recalculation time | +| ↳ `games_in_current_week` | boolean | Whether the season has fixtures this week | + +### `sportmonks_football_get_seasons_by_team` + +Retrieve all seasons for a team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stages\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `seasons` | array | Array of season objects for the team | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Tie-breaker rule of the season | +| ↳ `name` | string | Name of the season \(e.g. 2023/2024\) | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `standing_method` | string | Standing calculation method | +| ↳ `starting_at` | string | Start date of the season | +| ↳ `ending_at` | string | End date of the season | +| ↳ `standings_recalculated_at` | string | Last standings recalculation time | +| ↳ `games_in_current_week` | boolean | Whether the season has fixtures this week | + +### `sportmonks_football_get_stage` + +Retrieve a single football stage by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stageId` | string | Yes | The unique id of the stage | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;rounds\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stage` | object | The requested stage object | +| ↳ `id` | number | Unique id of the stage | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League of the stage | +| ↳ `season_id` | number | Season of the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Sort order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Start date of the stage | +| ↳ `ending_at` | string | End date of the stage | +| ↳ `games_in_current_week` | boolean | Whether the stage has fixtures this week | + +### `sportmonks_football_get_stage_statistics` + +Retrieve all available statistics for a stage ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stageId` | string | Yes | The unique id of the stage | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant\) | +| `filters` | string | No | Filters to apply \(e.g. seasonstatisticTypes:52,88\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `statistics` | array | Array of statistic entries for the stage | +| ↳ `id` | number | Unique id of the statistic record | +| ↳ `model_id` | number | Id of the entity the statistic belongs to | +| ↳ `type_id` | number | Type of the statistic | +| ↳ `relation_id` | number | Related entity id \(e.g. participant\) when applicable | +| ↳ `value` | json | Statistic value payload \(varies by type\) | + +### `sportmonks_football_get_stages` + +Retrieve all football stages available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;rounds\) | +| `filters` | string | No | Filters to apply \(e.g. stageSeasons:19735\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage objects | +| ↳ `id` | number | Unique id of the stage | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League of the stage | +| ↳ `season_id` | number | Season of the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Sort order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Start date of the stage | +| ↳ `ending_at` | string | End date of the stage | +| ↳ `games_in_current_week` | boolean | Whether the stage has fixtures this week | + +### `sportmonks_football_get_stages_by_season` + +Retrieve all stages for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;rounds\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage objects for the season | +| ↳ `id` | number | Unique id of the stage | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League of the stage | +| ↳ `season_id` | number | Season of the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Sort order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Start date of the stage | +| ↳ `ending_at` | string | End date of the stage | +| ↳ `games_in_current_week` | boolean | Whether the stage has fixtures this week | + +### `sportmonks_football_get_standing_corrections_by_season` + +Retrieve point corrections (awarded or deducted) for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;stage\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `corrections` | array | Array of standing correction entries for the season | +| ↳ `id` | number | Unique id of the standing correction | +| ↳ `season_id` | number | Season related to the correction | +| ↳ `stage_id` | number | Stage related to the correction | +| ↳ `group_id` | number | Group related to the correction | +| ↳ `type_id` | number | Type of the correction | +| ↳ `value` | number | Amount of points awarded or deducted | +| ↳ `calc_type` | string | Calculation type applied \(e.g. + or -\) | +| ↳ `participant_type` | string | Type of the participant \(e.g. team\) | +| ↳ `participant_id` | number | Participant the correction applies to | +| ↳ `active` | boolean | Whether the correction is active | + +### `sportmonks_football_get_standings` + +Retrieve all standings available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;league;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of standing entries | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Group related to the standing | +| ↳ `round_id` | number | Round related to the standing | +| ↳ `standing_rule_id` | number | Standing rule related to the standing | +| ↳ `position` | number | Position of the team in the standing | +| ↳ `result` | string | Movement of the team in the standing | +| ↳ `points` | number | Points the team has gathered | + +### `sportmonks_football_get_standings_by_round` + +Retrieve the full standing table for a round ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `roundId` | string | Yes | The unique id of the round | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply \(e.g. standingGroups:246697\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of standing entries for the round | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Group related to the standing | +| ↳ `round_id` | number | Round related to the standing | +| ↳ `standing_rule_id` | number | Standing rule related to the standing | +| ↳ `position` | number | Position of the team in the standing | +| ↳ `result` | string | Movement of the team in the standing | +| ↳ `points` | number | Points the team has gathered | + +### `sportmonks_football_get_standings_by_season` + +Retrieve the full league standings table for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details;form\) | +| `filters` | string | No | Filters to apply \(e.g. standingStages:77453568\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of standing entries for the season | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Group related to the standing | +| ↳ `round_id` | number | Round related to the standing | +| ↳ `standing_rule_id` | number | Standing rule related to the standing | +| ↳ `position` | number | Position of the team in the standing | +| ↳ `result` | string | Movement of the team in the standing | +| ↳ `points` | number | Points the team has gathered | + +### `sportmonks_football_get_state` + +Retrieve a single fixture state by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stateId` | string | Yes | The unique id of the state | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `state` | object | The requested fixture state object | +| ↳ `id` | number | Unique id of the state | +| ↳ `state` | string | State code \(e.g. NS, INPLAY_1ST_HALF\) | +| ↳ `name` | string | Full name of the state \(e.g. Not Started\) | +| ↳ `short_name` | string | Short name of the state \(e.g. NS\) | +| ↳ `developer_name` | string | Developer name of the state | + +### `sportmonks_football_get_states` + +Retrieve all fixture states (e.g. Not Started, 1st Half, Full Time) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `states` | array | Array of fixture state objects | +| ↳ `id` | number | Unique id of the state | +| ↳ `state` | string | State code \(e.g. NS, INPLAY_1ST_HALF\) | +| ↳ `name` | string | Full name of the state \(e.g. Not Started\) | +| ↳ `short_name` | string | Short name of the state \(e.g. NS\) | +| ↳ `developer_name` | string | Developer name of the state | + +### `sportmonks_football_get_team` + +Retrieve a single football team by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue;coaches;players.player\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `team` | object | The requested team object | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Home venue of the team | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the last played match | + +### `sportmonks_football_get_team_rankings` + +Retrieve all team rankings available within your Sportmonks subscription (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. team\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teamRankings` | array | Array of team ranking objects | +| ↳ `id` | number | Unique id of the team ranking | +| ↳ `team_id` | number | Team related to the ranking | +| ↳ `date` | string | Date of the ranking | +| ↳ `current_rank` | number | Placement of the team on that date | +| ↳ `scaled_score` | number | Scaled score of the team \(0-100\) | + +### `sportmonks_football_get_team_rankings_by_date` + +Retrieve team rankings for a given date (YYYY-MM-DD) from Sportmonks (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `date` | string | Yes | The ranking date in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. team\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teamRankings` | array | Array of team ranking objects for the date | +| ↳ `id` | number | Unique id of the team ranking | +| ↳ `team_id` | number | Team related to the ranking | +| ↳ `date` | string | Date of the ranking | +| ↳ `current_rank` | number | Placement of the team on that date | +| ↳ `scaled_score` | number | Scaled score of the team \(0-100\) | + +### `sportmonks_football_get_team_rankings_by_team` + +Retrieve team rankings for a team ID from Sportmonks (beta) + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. team\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teamRankings` | array | Array of team ranking objects for the team | +| ↳ `id` | number | Unique id of the team ranking | +| ↳ `team_id` | number | Team related to the ranking | +| ↳ `date` | string | Date of the ranking | +| ↳ `current_rank` | number | Placement of the team on that date | +| ↳ `scaled_score` | number | Scaled score of the team \(0-100\) | + +### `sportmonks_football_get_team_squad` + +Retrieve the current domestic squad for a team by team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;position\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `squad` | array | Array of squad entries for the team | +| ↳ `id` | number | Unique id of the squad record | +| ↳ `transfer_id` | number | Transfer id of the squad record | +| ↳ `player_id` | number | Player in the squad | +| ↳ `team_id` | number | Team of the squad | +| ↳ `position_id` | number | Position of the player in the squad | +| ↳ `detailed_position_id` | number | Detailed position of the player in the squad | +| ↳ `jersey_number` | number | Jersey number of the player | +| ↳ `start` | string | Start contract date of the player | +| ↳ `end` | string | End contract date of the player | + +### `sportmonks_football_get_team_squad_by_season` + +Retrieve the (historical) squad for a team in a specific season from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;position\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `squad` | array | Array of squad entries for the team in the season | +| ↳ `id` | number | Unique id of the squad record | +| ↳ `transfer_id` | number | Transfer id of the squad record | +| ↳ `player_id` | number | Player in the squad | +| ↳ `team_id` | number | Team of the squad | +| ↳ `position_id` | number | Position of the player in the squad | +| ↳ `detailed_position_id` | number | Detailed position of the player in the squad | +| ↳ `jersey_number` | number | Jersey number of the player | +| ↳ `start` | string | Start contract date of the player | +| ↳ `end` | string | End contract date of the player | + +### `sportmonks_football_get_teams_by_country` + +Retrieve all teams for a country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order teams by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team objects for the country | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Home venue of the team | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the last played match | + +### `sportmonks_football_get_teams_by_season` + +Retrieve all teams for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order teams by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team objects for the season | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Home venue of the team | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the last played match | + +### `sportmonks_football_get_topscorers_by_season` + +Retrieve the topscorers (goals, assists, cards) for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;participant;type\) | +| `filters` | string | No | Filters to apply \(e.g. seasontopscorerTypes:208\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order topscorers by position \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `topscorers` | array | Array of topscorer entries for the season | +| ↳ `id` | number | Unique id of the topscorer record | +| ↳ `season_id` | number | Season related to the topscorer \(absent on stage topscorers\) | +| ↳ `league_id` | number | League related to the topscorer | +| ↳ `stage_id` | number | Stage related to the topscorer | +| ↳ `player_id` | number | Player related to the topscorer | +| ↳ `participant_id` | number | Team related to the topscorer | +| ↳ `type_id` | number | Type of the topscorer \(goals, assists, cards\) | +| ↳ `position` | number | Position of the topscorer | +| ↳ `total` | number | Number of goals, assists or cards | + +### `sportmonks_football_get_topscorers_by_stage` + +Retrieve topscorers for a stage by stage ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stageId` | string | Yes | The unique id of the stage | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;participant;type\) | +| `filters` | string | No | Filters to apply \(e.g. stageTopscorerTypes:208\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `topscorers` | array | Array of topscorer entries for the stage | +| ↳ `id` | number | Unique id of the topscorer record | +| ↳ `season_id` | number | Season related to the topscorer \(absent on stage topscorers\) | +| ↳ `league_id` | number | League related to the topscorer | +| ↳ `stage_id` | number | Stage related to the topscorer | +| ↳ `player_id` | number | Player related to the topscorer | +| ↳ `participant_id` | number | Team related to the topscorer | +| ↳ `type_id` | number | Type of the topscorer \(goals, assists, cards\) | +| ↳ `position` | number | Position of the topscorer | +| ↳ `total` | number | Number of goals, assists or cards | + +### `sportmonks_football_get_totw` + +Retrieve all available Team of the Week (TOTW) entries from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;team;player;round\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `totw` | array | Array of Team of the Week entries | +| ↳ `id` | number | Unique id of the TOTW entry | +| ↳ `player_id` | number | Player of the team of the week | +| ↳ `fixture_id` | number | Fixture the TOTW player played in | +| ↳ `round_id` | number | Round the fixture is played at | +| ↳ `team_id` | number | Team the TOTW player played for | +| ↳ `rating` | string | Rating of the TOTW player | +| ↳ `formation_position` | number | Player position in the TOTW formation | +| ↳ `formation` | string | The TOTW's formation | + +### `sportmonks_football_get_totw_by_round` + +Retrieve the Team of the Week (TOTW) for a round ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `roundId` | string | Yes | The unique id of the round | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixture;team;player;round\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `totw` | array | Array of Team of the Week entries for the round | +| ↳ `id` | number | Unique id of the TOTW entry | +| ↳ `player_id` | number | Player of the team of the week | +| ↳ `fixture_id` | number | Fixture the TOTW player played in | +| ↳ `round_id` | number | Round the fixture is played at | +| ↳ `team_id` | number | Team the TOTW player played for | +| ↳ `rating` | string | Rating of the TOTW player | +| ↳ `formation_position` | number | Player position in the TOTW formation | +| ↳ `formation` | string | The TOTW's formation | + +### `sportmonks_football_get_transfer` + +Retrieve a single transfer by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `transferId` | string | Yes | The unique id of the transfer | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transfer` | object | The requested transfer object | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_transfer_rumour` + +Retrieve a single transfer rumour by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `rumourId` | string | Yes | The unique id of the transfer rumour | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transferRumour` | object | The requested transfer rumour object | +| ↳ `id` | number | Unique id of the transfer rumour | +| ↳ `sport_id` | number | Sport of the transfer rumour | +| ↳ `player_id` | number | Player the rumour relates to | +| ↳ `position_id` | number | Position id of the player | +| ↳ `from_team_id` | number | Team the player would transfer from | +| ↳ `to_team_id` | number | Team the player would transfer to | +| ↳ `transfer_fee_id` | number | Transfer fee id of the rumour | +| ↳ `probability` | string | Probability of the rumour \(e.g. LOW\) | +| ↳ `source_name` | string | Name of the source of the rumour | +| ↳ `source_url` | string | URL of the source of the rumour | +| ↳ `amount` | number | Estimated transfer fee amount | +| ↳ `currency` | string | Currency of the amount | +| ↳ `date` | string | Date of the rumour | +| ↳ `type_id` | number | Type of the transfer rumour | + +### `sportmonks_football_get_transfer_rumours_between_dates` + +Retrieve transfer rumours within a date range (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format | +| `endDate` | string | Yes | End date in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transferRumours` | array | Array of transfer rumour objects within the date range | +| ↳ `id` | number | Unique id of the transfer rumour | +| ↳ `sport_id` | number | Sport of the transfer rumour | +| ↳ `player_id` | number | Player the rumour relates to | +| ↳ `position_id` | number | Position id of the player | +| ↳ `from_team_id` | number | Team the player would transfer from | +| ↳ `to_team_id` | number | Team the player would transfer to | +| ↳ `transfer_fee_id` | number | Transfer fee id of the rumour | +| ↳ `probability` | string | Probability of the rumour \(e.g. LOW\) | +| ↳ `source_name` | string | Name of the source of the rumour | +| ↳ `source_url` | string | URL of the source of the rumour | +| ↳ `amount` | number | Estimated transfer fee amount | +| ↳ `currency` | string | Currency of the amount | +| ↳ `date` | string | Date of the rumour | +| ↳ `type_id` | number | Type of the transfer rumour | + +### `sportmonks_football_get_transfer_rumours_by_player` + +Retrieve transfer rumours for a player ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `playerId` | string | Yes | The unique id of the player | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transferRumours` | array | Array of transfer rumour objects for the player | +| ↳ `id` | number | Unique id of the transfer rumour | +| ↳ `sport_id` | number | Sport of the transfer rumour | +| ↳ `player_id` | number | Player the rumour relates to | +| ↳ `position_id` | number | Position id of the player | +| ↳ `from_team_id` | number | Team the player would transfer from | +| ↳ `to_team_id` | number | Team the player would transfer to | +| ↳ `transfer_fee_id` | number | Transfer fee id of the rumour | +| ↳ `probability` | string | Probability of the rumour \(e.g. LOW\) | +| ↳ `source_name` | string | Name of the source of the rumour | +| ↳ `source_url` | string | URL of the source of the rumour | +| ↳ `amount` | number | Estimated transfer fee amount | +| ↳ `currency` | string | Currency of the amount | +| ↳ `date` | string | Date of the rumour | +| ↳ `type_id` | number | Type of the transfer rumour | + +### `sportmonks_football_get_transfer_rumours_by_team` + +Retrieve transfer rumours for a team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transferRumours` | array | Array of transfer rumour objects for the team | +| ↳ `id` | number | Unique id of the transfer rumour | +| ↳ `sport_id` | number | Sport of the transfer rumour | +| ↳ `player_id` | number | Player the rumour relates to | +| ↳ `position_id` | number | Position id of the player | +| ↳ `from_team_id` | number | Team the player would transfer from | +| ↳ `to_team_id` | number | Team the player would transfer to | +| ↳ `transfer_fee_id` | number | Transfer fee id of the rumour | +| ↳ `probability` | string | Probability of the rumour \(e.g. LOW\) | +| ↳ `source_name` | string | Name of the source of the rumour | +| ↳ `source_url` | string | URL of the source of the rumour | +| ↳ `amount` | number | Estimated transfer fee amount | +| ↳ `currency` | string | Currency of the amount | +| ↳ `date` | string | Date of the rumour | +| ↳ `type_id` | number | Type of the transfer rumour | + +### `sportmonks_football_get_transfers_between_dates` + +Retrieve transfers within a date range (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | Start date in YYYY-MM-DD format | +| `endDate` | string | Yes | End date in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply \(e.g. transferTypes:219,220\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transfers` | array | Array of transfer objects within the date range | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_transfers_by_player` + +Retrieve transfers for a player by player ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `playerId` | string | Yes | The unique id of the player | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fromTeam;toTeam;type\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transfers` | array | Array of transfer objects for the player | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_transfers_by_team` + +Retrieve transfers for a team by team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. player;fromTeam;toTeam\) | +| `filters` | string | No | Filters to apply \(e.g. transferTypes:219,220\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `transfers` | array | Array of transfer objects for the team | +| ↳ `id` | number | Unique id of the transfer | +| ↳ `sport_id` | number | Sport of the transfer | +| ↳ `player_id` | number | Player who transferred | +| ↳ `type_id` | number | Type of the transfer | +| ↳ `from_team_id` | number | Team the player transferred from | +| ↳ `to_team_id` | number | Team the player transferred to | +| ↳ `position_id` | number | Position id of the transfer | +| ↳ `detailed_position_id` | number | Detailed position id of the transfer | +| ↳ `date` | string | Date of the transfer | +| ↳ `career_ended` | boolean | Whether the transfer ended the career | +| ↳ `completed` | boolean | Whether the transfer is completed | +| ↳ `amount` | number | Transfer fee amount | + +### `sportmonks_football_get_tv_station` + +Retrieve a single TV station by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `tvStationId` | string | Yes | The unique id of the TV station | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `tvStation` | object | The requested TV station object | +| ↳ `id` | number | Unique id of the TV station | +| ↳ `name` | string | Name of the TV station | +| ↳ `url` | string | URL of the TV station | +| ↳ `image_path` | string | Image path of the TV station | +| ↳ `type` | string | Type of the TV station \(tv, channel\) | +| ↳ `related_id` | number | Related id of the TV station | + +### `sportmonks_football_get_tv_stations` + +Retrieve all TV stations available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `tvStations` | array | Array of TV station objects | +| ↳ `id` | number | Unique id of the TV station | +| ↳ `name` | string | Name of the TV station | +| ↳ `url` | string | URL of the TV station | +| ↳ `image_path` | string | Image path of the TV station | +| ↳ `type` | string | Type of the TV station \(tv, channel\) | +| ↳ `related_id` | number | Related id of the TV station | + +### `sportmonks_football_get_tv_stations_by_fixture` + +Retrieve broadcasting TV stations for a fixture by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. fixtures;countries\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `tvStations` | array | Array of TV station objects broadcasting the fixture | +| ↳ `id` | number | Unique id of the TV station | +| ↳ `name` | string | Name of the TV station | +| ↳ `url` | string | URL of the TV station | +| ↳ `image_path` | string | Image path of the TV station | +| ↳ `type` | string | Type of the TV station \(tv, channel\) | +| ↳ `related_id` | number | Related id of the TV station | + +### `sportmonks_football_get_upcoming_fixtures_by_market` + +Retrieve all upcoming fixtures for a market ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `marketId` | string | Yes | The unique id of the market | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;odds\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of upcoming fixture objects for the market | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_upcoming_fixtures_by_tv_station` + +Retrieve all upcoming fixtures available for a TV station ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `tvStationId` | string | Yes | The unique id of the TV station | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of upcoming fixture objects for the TV station | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_get_value_bets` + +Retrieve all value bets available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `valueBets` | array | Array of value bet prediction objects | +| ↳ `id` | number | Unique id of the prediction | +| ↳ `fixture_id` | number | Fixture related to the prediction | +| ↳ `predictions` | json | Prediction payload \(varies by type: score map, value bet object, etc.\) | +| ↳ `type_id` | number | Type of the prediction | + +### `sportmonks_football_get_value_bets_by_fixture` + +Retrieve value bet predictions for a fixture by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. type;fixture\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `valueBets` | array | Array of value bet prediction entries for the fixture | +| ↳ `id` | number | Unique id of the prediction | +| ↳ `fixture_id` | number | Fixture related to the prediction | +| ↳ `predictions` | json | Prediction payload \(varies by type: score map, value bet object, etc.\) | +| ↳ `type_id` | number | Type of the prediction | + +### `sportmonks_football_get_venue` + +Retrieve a single football venue by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `venueId` | string | Yes | The unique id of the venue | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city;fixtures\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venue` | object | The requested venue object | +| ↳ `id` | number | Unique id of the venue | +| ↳ `country_id` | number | Country of the venue | +| ↳ `city_id` | number | City of the venue | +| ↳ `name` | string | Name of the venue | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Seating capacity of the venue | +| ↳ `image_path` | string | Image path of the venue | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface type of the venue | +| ↳ `national_team` | boolean | Whether the venue is used by the national team | + +### `sportmonks_football_get_venues` + +Retrieve all football venues available within your Sportmonks subscription + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply \(e.g. venueCountries:98\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue objects | +| ↳ `id` | number | Unique id of the venue | +| ↳ `country_id` | number | Country of the venue | +| ↳ `city_id` | number | City of the venue | +| ↳ `name` | string | Name of the venue | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Seating capacity of the venue | +| ↳ `image_path` | string | Image path of the venue | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface type of the venue | +| ↳ `national_team` | boolean | Whether the venue is used by the national team | + +### `sportmonks_football_get_venues_by_season` + +Retrieve all venues for a season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue objects for the season | +| ↳ `id` | number | Unique id of the venue | +| ↳ `country_id` | number | Country of the venue | +| ↳ `city_id` | number | City of the venue | +| ↳ `name` | string | Name of the venue | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Seating capacity of the venue | +| ↳ `image_path` | string | Image path of the venue | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface type of the venue | +| ↳ `national_team` | boolean | Whether the venue is used by the national team | + +### `sportmonks_football_search_coaches` + +Search for football coaches by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The coach name to search for \(e.g. Gerrard\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `coaches` | array | Array of coach objects matching the search query | +| ↳ `id` | number | Unique id of the coach | +| ↳ `player_id` | number | Player related to the coach | +| ↳ `sport_id` | number | Sport of the coach | +| ↳ `country_id` | number | Country of the coach | +| ↳ `nationality_id` | number | Nationality of the coach | +| ↳ `city_id` | number | Birth city of the coach | +| ↳ `common_name` | string | Common name of the coach | +| ↳ `firstname` | string | First name of the coach | +| ↳ `lastname` | string | Last name of the coach | +| ↳ `name` | string | Name of the coach | +| ↳ `display_name` | string | Display name of the coach | +| ↳ `image_path` | string | URL to the coach headshot | +| ↳ `height` | number | Height of the coach in cm | +| ↳ `weight` | number | Weight of the coach in kg | +| ↳ `date_of_birth` | string | Date of birth of the coach | +| ↳ `gender` | string | Gender of the coach | + +### `sportmonks_football_search_fixtures` + +Search for football fixtures by name (participants) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The fixture name to search for \(e.g. Celtic\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;scores\) | +| `filters` | string | No | Filters to apply \(e.g. fixtureLeagues:501\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of fixture objects matching the search query | +| ↳ `id` | number | Unique id of the fixture | +| ↳ `sport_id` | number | Sport the fixture is played at | +| ↳ `league_id` | number | League the fixture is played in | +| ↳ `season_id` | number | Season the fixture is played in | +| ↳ `stage_id` | number | Stage the fixture is played in | +| ↳ `group_id` | number | Group the fixture is played in | +| ↳ `aggregate_id` | number | Aggregate the fixture belongs to | +| ↳ `round_id` | number | Round the fixture is played in | +| ↳ `state_id` | number | State \(status\) of the fixture | +| ↳ `venue_id` | number | Venue the fixture is played at | +| ↳ `name` | string | Name of the fixture \(participants\) | +| ↳ `starting_at` | string | Datetime the fixture starts | +| ↳ `result_info` | string | Final result summary | +| ↳ `leg` | string | Leg of the fixture \(e.g. 1/1\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Length of the fixture in minutes | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Whether odds are available | +| ↳ `has_premium_odds` | boolean | Whether premium odds are available | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_football_search_leagues` + +Search for football leagues by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The league name to search for \(e.g. Premier\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;currentSeason\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order leagues \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects matching the search query | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | number | Whether the league is active \(1\) or inactive \(0\) | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date the last fixture was played | +| ↳ `category` | number | Importance category of the league \(1-4\) | + +### `sportmonks_football_search_players` + +Search for football players by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The player name to search for \(e.g. Tavernier\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;position;teams.team\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order players by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `players` | array | Array of player objects matching the search query | +| ↳ `id` | number | Unique id of the player | +| ↳ `sport_id` | number | Sport of the player | +| ↳ `country_id` | number | Country of birth of the player | +| ↳ `nationality_id` | number | Nationality of the player | +| ↳ `city_id` | number | City of birth of the player | +| ↳ `position_id` | number | Position of the player | +| ↳ `detailed_position_id` | number | Detailed position of the player | +| ↳ `type_id` | number | Type of the player | +| ↳ `common_name` | string | Name the player is known for | +| ↳ `firstname` | string | First name of the player | +| ↳ `lastname` | string | Last name of the player | +| ↳ `name` | string | Name of the player | +| ↳ `display_name` | string | Display name of the player | +| ↳ `image_path` | string | URL to the player headshot | +| ↳ `height` | number | Height of the player in cm | +| ↳ `weight` | number | Weight of the player in kg | +| ↳ `date_of_birth` | string | Date of birth of the player | +| ↳ `gender` | string | Gender of the player | + +### `sportmonks_football_search_referees` + +Search for football referees by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The referee name to search for | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `referees` | array | Array of referee objects matching the search query | +| ↳ `id` | number | Unique id of the referee | +| ↳ `sport_id` | number | Sport of the referee | +| ↳ `country_id` | number | Country of the referee | +| ↳ `nationality_id` | number | Nationality of the referee | +| ↳ `city_id` | number | Birth city of the referee | +| ↳ `common_name` | string | Common name of the referee | +| ↳ `firstname` | string | First name of the referee | +| ↳ `lastname` | string | Last name of the referee | +| ↳ `name` | string | Name of the referee | +| ↳ `display_name` | string | Display name of the referee | +| ↳ `image_path` | string | URL to the referee headshot | +| ↳ `height` | number | Height of the referee in cm | +| ↳ `weight` | number | Weight of the referee in kg | +| ↳ `date_of_birth` | string | Date of birth of the referee | +| ↳ `gender` | string | Gender of the referee | + +### `sportmonks_football_search_rounds` + +Search for football rounds by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The round name to search for \(e.g. 5\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `rounds` | array | Array of round objects matching the search query | +| ↳ `id` | number | Unique id of the round | +| ↳ `sport_id` | number | Sport of the round | +| ↳ `league_id` | number | League of the round | +| ↳ `season_id` | number | Season of the round | +| ↳ `stage_id` | number | Stage of the round | +| ↳ `name` | string | Name of the round | +| ↳ `finished` | boolean | Whether the round is finished | +| ↳ `is_current` | boolean | Whether the round is the current round | +| ↳ `starting_at` | string | Start date of the round | +| ↳ `ending_at` | string | End date of the round | +| ↳ `games_in_current_week` | boolean | Whether the round has fixtures this week | + +### `sportmonks_football_search_seasons` + +Search for football seasons by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The season name to search for \(e.g. 2023/2024\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `seasons` | array | Array of season objects matching the search query | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Tie-breaker rule of the season | +| ↳ `name` | string | Name of the season \(e.g. 2023/2024\) | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `standing_method` | string | Standing calculation method | +| ↳ `starting_at` | string | Start date of the season | +| ↳ `ending_at` | string | End date of the season | +| ↳ `standings_recalculated_at` | string | Last standings recalculation time | +| ↳ `games_in_current_week` | boolean | Whether the season has fixtures this week | + +### `sportmonks_football_search_stages` + +Search for football stages by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The stage name to search for \(e.g. Group\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage objects matching the search query | +| ↳ `id` | number | Unique id of the stage | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League of the stage | +| ↳ `season_id` | number | Season of the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Sort order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Start date of the stage | +| ↳ `ending_at` | string | End date of the stage | +| ↳ `games_in_current_week` | boolean | Whether the stage has fixtures this week | + +### `sportmonks_football_search_teams` + +Search for football teams by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The team name to search for \(e.g. Celtic\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;venue\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order teams by id \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team objects matching the search query | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Home venue of the team | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the last played match | + +### `sportmonks_football_search_venues` + +Search for football venues by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The venue name to search for \(e.g. Celtic Park\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue objects matching the search query | +| ↳ `id` | number | Unique id of the venue | +| ↳ `country_id` | number | Country of the venue | +| ↳ `city_id` | number | City of the venue | +| ↳ `name` | string | Name of the venue | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Seating capacity of the venue | +| ↳ `image_path` | string | Image path of the venue | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface type of the venue | +| ↳ `national_team` | boolean | Whether the venue is used by the national team | + +### `sportmonks_motorsport_get_all_fixtures` + +Retrieve all motorsport fixtures (sessions) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of motorsport fixture \(session\) objects | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_current_leagues_by_team` + +Retrieve the current motorsport leagues for a team by team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team \(constructor\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of current league objects for the team | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_driver` + Retrieve a single motorsport driver by their ID from Sportmonks #### Input @@ -725,45 +3985,2016 @@ Retrieve a single motorsport driver by their ID from Sportmonks | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `driverId` | string | Yes | The unique id of the driver | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | -| `filters` | string | No | Filters to apply | +| `driverId` | string | Yes | The unique id of the driver | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `driver` | object | The requested driver object | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_get_driver_standings` + +Retrieve all driver championship standings from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of driver standing entries | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Driver or team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `standing_rule_id` | number | Not used in the Motorsport API | +| ↳ `position` | number | Position of the participant in the standing | +| ↳ `result` | string | Not used in the Motorsport API | +| ↳ `points` | number | Points the participant has gathered | + +### `sportmonks_motorsport_get_driver_standings_by_season` + +Retrieve the drivers championship standings for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of driver standing entries for the season | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Driver or team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `standing_rule_id` | number | Not used in the Motorsport API | +| ↳ `position` | number | Position of the participant in the standing | +| ↳ `result` | string | Not used in the Motorsport API | +| ↳ `points` | number | Points the participant has gathered | + +### `sportmonks_motorsport_get_drivers` + +Retrieve all motorsport drivers from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `drivers` | array | Array of driver objects | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_get_drivers_by_country` + +Retrieve all motorsport drivers for a country by country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `drivers` | array | Array of driver objects for the country | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_get_drivers_by_season` + +Retrieve all motorsport drivers for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `drivers` | array | Array of driver objects for the season | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_get_fixture` + +Retrieve a single motorsport fixture (session) by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results;latestLaps;pitstops\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixture` | object | The requested motorsport fixture \(session\) object | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_fixtures_by_date` + +Retrieve motorsport fixtures (sessions) on a specific date (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `date` | string | Yes | The date to fetch fixtures for, in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;venue\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of motorsport fixture \(session\) objects for the requested date | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_fixtures_by_date_range` + +Retrieve motorsport fixtures (sessions) between two dates (YYYY-MM-DD, max 100 days) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `startDate` | string | Yes | The start date of the range, in YYYY-MM-DD format | +| `endDate` | string | Yes | The end date of the range, in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;venue\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order fixtures by starting_at \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of motorsport fixture \(session\) objects within the requested date range | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_fixtures_by_ids` + +Retrieve multiple motorsport fixtures (sessions) by their IDs (max 50) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureIds` | string | Yes | Comma-separated list of fixture ids \(max 50, e.g. 19408487,19408480\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of motorsport fixture \(session\) objects for the requested ids | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_laps_by_fixture` + +Retrieve all laps for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `laps` | array | Array of lap objects for the fixture | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_laps_by_fixture_and_driver` + +Retrieve all laps for a motorsport fixture and driver from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `driverId` | string | Yes | The unique id of the driver | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `laps` | array | Array of lap objects for the fixture and driver | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_laps_by_fixture_and_lap` + +Retrieve all laps for a motorsport fixture and lap number from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `lapNumber` | string | Yes | The lap number to retrieve | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `laps` | array | Array of lap objects for the fixture and lap number | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_latest_laps_by_fixture` + +Retrieve the latest laps for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `laps` | array | Array of the latest lap objects for the fixture | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_latest_pitstops_by_fixture` + +Retrieve the latest pitstops for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `pitstops` | array | Array of the latest pitstop objects for the fixture | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_latest_stints_by_fixture` + +Retrieve the latest tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stints` | array | Array of the latest stint objects for the fixture | +| ↳ `id` | number | Unique id of the stint | +| ↳ `fixture_id` | number | Fixture related to the stint | +| ↳ `stint_number` | number | Stint number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the stint | +| ↳ `is_latest` | boolean | Whether it is the latest stint | + +### `sportmonks_motorsport_get_latest_updated_drivers` + +Retrieve the most recently updated motorsport drivers from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `drivers` | array | Array of recently updated driver objects | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_get_latest_updated_fixtures` + +Retrieve the most recently updated motorsport fixtures (sessions) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of recently updated motorsport fixture \(session\) objects | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_league` + +Retrieve a single motorsport league by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `leagueId` | string | Yes | The unique id of the league | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `league` | object | The requested league object | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_leagues` + +Retrieve all motorsport leagues from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_leagues_by_country` + +Retrieve all motorsport leagues for a country by country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects for the country | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_leagues_by_date` + +Retrieve all motorsport leagues with fixtures on a specific date (YYYY-MM-DD) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `date` | string | Yes | The date to fetch leagues for, in YYYY-MM-DD format | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects with fixtures on the requested date | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_leagues_by_live` + +Retrieve all motorsport leagues that currently have live fixtures from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects that currently have live fixtures | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_leagues_by_team` + +Retrieve all current and historical motorsport leagues for a team by team ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team \(constructor\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects for the team | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_livescores` + +Retrieve all live motorsport fixtures (sessions) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participants;results\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `fixtures` | array | Array of live motorsport fixture \(session\) objects | +| ↳ `id` | number | Unique id of the fixture \(session\) | +| ↳ `sport_id` | number | Sport of the fixture | +| ↳ `league_id` | number | League the fixture is held in | +| ↳ `season_id` | number | Season the fixture is held in | +| ↳ `stage_id` | number | Stage \(race weekend\) the fixture is held in | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `aggregate_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `state_id` | number | State the fixture is currently in | +| ↳ `venue_id` | number | Venue \(track\) the fixture is held at | +| ↳ `name` | string | Name of the fixture \(e.g. Practice 1, Race\) | +| ↳ `starting_at` | string | Start date and time | +| ↳ `result_info` | string | Final result info | +| ↳ `leg` | string | Stage of the fixture \(e.g. 2/3 for Practice 2\) | +| ↳ `details` | string | Details about the fixture | +| ↳ `length` | number | Session length in minutes or total laps | +| ↳ `placeholder` | boolean | Whether the fixture is a placeholder | +| ↳ `has_odds` | boolean | Not used in the Motorsport API | +| ↳ `has_premium_odds` | boolean | Not used in the Motorsport API | +| ↳ `starting_at_timestamp` | number | UNIX timestamp of the start time | + +### `sportmonks_motorsport_get_pitstops_by_fixture` + +Retrieve all pitstops for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `pitstops` | array | Array of pitstop objects for the fixture | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_pitstops_by_fixture_and_driver` + +Retrieve all pitstops for a motorsport fixture and driver from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `driverId` | string | Yes | The unique id of the driver | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `pitstops` | array | Array of pitstop objects for the fixture and driver | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_pitstops_by_fixture_and_lap` + +Retrieve all pitstops for a motorsport fixture and lap number from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `lapNumber` | string | Yes | The lap number to retrieve | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `pitstops` | array | Array of pitstop objects for the fixture and lap number | +| ↳ `id` | number | Unique id of the lap/pitstop | +| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | +| ↳ `lap_number` | number | Lap number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the lap/pitstop | +| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | + +### `sportmonks_motorsport_get_race_results_by_season_and_driver` + +Retrieve race results (stages with fixtures, lineups and lineup details) for a season and driver from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `driverId` | string | Yes | The unique id of the driver | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `results` | array | Array of stage objects for the season and driver, each including nested fixtures, lineups and lineup details | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_race_results_by_season_and_team` + +Retrieve race results (stages with fixtures, lineups and lineup details) for a season and team from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `teamId` | string | Yes | The unique id of the team \(constructor\) | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `results` | array | Array of stage objects for the season and team, each including nested fixtures, lineups and lineup details | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_schedules_by_season` + +Retrieve the full schedule (stages with nested fixtures and venues) for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `schedules` | array | Array of stage objects for the season schedule, each including nested fixtures and venues | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_season` + +Retrieve a single motorsport season by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stages\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `season` | object | The requested season object | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | +| ↳ `name` | string | Name of the season | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `starting_at` | string | Starting date of the season | +| ↳ `ending_at` | string | Ending date of the season | +| ↳ `standings_recalculated_at` | string | Timestamp when standings were last updated | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_seasons` + +Retrieve all motorsport seasons from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;stages\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `seasons` | array | Array of season objects | +| ↳ `id` | number | Unique id of the season | +| ↳ `sport_id` | number | Sport of the season | +| ↳ `league_id` | number | League of the season | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | +| ↳ `name` | string | Name of the season | +| ↳ `finished` | boolean | Whether the season is finished | +| ↳ `pending` | boolean | Whether the season is pending | +| ↳ `is_current` | boolean | Whether the season is the current season | +| ↳ `starting_at` | string | Starting date of the season | +| ↳ `ending_at` | string | Ending date of the season | +| ↳ `standings_recalculated_at` | string | Timestamp when standings were last updated | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_stage` + +Retrieve a single motorsport stage (race weekend) by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stageId` | string | Yes | The unique id of the stage \(race weekend\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;fixtures\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stage` | object | The requested stage \(race weekend\) object | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_stages` + +Retrieve all motorsport stages (race weekends) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;fixtures\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage \(race weekend\) objects | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_stages_by_season` + +Retrieve all motorsport stages (race weekends) for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;fixtures\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage \(race weekend\) objects for the season | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_state` + +Retrieve a single motorsport fixture state by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `stateId` | string | Yes | The unique id of the state | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `state` | object | The requested fixture state object | +| ↳ `id` | number | Unique id of the state | +| ↳ `state` | string | Abbreviation of the state | +| ↳ `name` | string | Full name of the state | +| ↳ `short_name` | string | Short name of the state | +| ↳ `developer_name` | string | Name recommended for developers to use | + +### `sportmonks_motorsport_get_states` + +Retrieve all possible motorsport fixture states from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `states` | array | Array of fixture state objects | +| ↳ `id` | number | Unique id of the state | +| ↳ `state` | string | Abbreviation of the state | +| ↳ `name` | string | Full name of the state | +| ↳ `short_name` | string | Short name of the state | +| ↳ `developer_name` | string | Name recommended for developers to use | + +### `sportmonks_motorsport_get_stints_by_fixture` + +Retrieve all tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stints` | array | Array of stint objects for the fixture | +| ↳ `id` | number | Unique id of the stint | +| ↳ `fixture_id` | number | Fixture related to the stint | +| ↳ `stint_number` | number | Stint number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the stint | +| ↳ `is_latest` | boolean | Whether it is the latest stint | + +### `sportmonks_motorsport_get_stints_by_fixture_and_driver` + +Retrieve all tyre stints for a motorsport fixture and driver from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `driverId` | string | Yes | The unique id of the driver | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stints` | array | Array of stint objects for the fixture and driver | +| ↳ `id` | number | Unique id of the stint | +| ↳ `fixture_id` | number | Fixture related to the stint | +| ↳ `stint_number` | number | Stint number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the stint | +| ↳ `is_latest` | boolean | Whether it is the latest stint | + +### `sportmonks_motorsport_get_stints_by_fixture_and_stint` + +Retrieve all tyre stints for a motorsport fixture and stint number from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | +| `stintNumber` | string | Yes | The stint number to retrieve | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stints` | array | Array of stint objects for the fixture and stint number | +| ↳ `id` | number | Unique id of the stint | +| ↳ `fixture_id` | number | Fixture related to the stint | +| ↳ `stint_number` | number | Stint number in the fixture | +| ↳ `driver_number` | number | Number of the driver | +| ↳ `participant_id` | number | Driver related to the stint | +| ↳ `is_latest` | boolean | Whether it is the latest stint | + +### `sportmonks_motorsport_get_team` + +Retrieve a single motorsport team (constructor) by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `teamId` | string | Yes | The unique id of the team \(constructor\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `team` | object | The requested team \(constructor\) object | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Not used in the Motorsport API | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team \(constructor\) | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the team's last session | + +### `sportmonks_motorsport_get_team_standings` + +Retrieve all team (constructor) championship standings from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of team \(constructor\) standing entries | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Driver or team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `standing_rule_id` | number | Not used in the Motorsport API | +| ↳ `position` | number | Position of the participant in the standing | +| ↳ `result` | string | Not used in the Motorsport API | +| ↳ `points` | number | Points the participant has gathered | + +### `sportmonks_motorsport_get_team_standings_by_season` + +Retrieve the constructors championship standings for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `standings` | array | Array of team \(constructor\) standing entries for the season | +| ↳ `id` | number | Unique id of the standing | +| ↳ `participant_id` | number | Driver or team related to the standing | +| ↳ `sport_id` | number | Sport related to the standing | +| ↳ `league_id` | number | League related to the standing | +| ↳ `season_id` | number | Season related to the standing | +| ↳ `stage_id` | number | Stage related to the standing | +| ↳ `group_id` | number | Not used in the Motorsport API | +| ↳ `round_id` | number | Not used in the Motorsport API | +| ↳ `standing_rule_id` | number | Not used in the Motorsport API | +| ↳ `position` | number | Position of the participant in the standing | +| ↳ `result` | string | Not used in the Motorsport API | +| ↳ `points` | number | Points the participant has gathered | + +### `sportmonks_motorsport_get_teams` + +Retrieve all motorsport teams (constructors) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team \(constructor\) objects | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Not used in the Motorsport API | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team \(constructor\) | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the team's last session | + +### `sportmonks_motorsport_get_teams_by_country` + +Retrieve all motorsport teams (constructors) for a country by country ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `countryId` | string | Yes | The unique id of the country | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team \(constructor\) objects for the country | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Not used in the Motorsport API | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team \(constructor\) | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the team's last session | + +### `sportmonks_motorsport_get_teams_by_season` + +Retrieve all motorsport teams (constructors) for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team \(constructor\) objects for the season | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Not used in the Motorsport API | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team \(constructor\) | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the team's last session | + +### `sportmonks_motorsport_get_venue` + +Retrieve a single motorsport venue (racing track) by its ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `venueId` | string | Yes | The unique id of the venue \(track\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venue` | object | The requested venue \(racing track\) object | +| ↳ `id` | number | Unique id of the venue \(track\) | +| ↳ `country_id` | number | Country the venue is in | +| ↳ `city_id` | number | City the venue is in | +| ↳ `name` | string | Name of the venue/track | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Capacity of the venue | +| ↳ `image_path` | string | URL to the track layout image | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface of the venue | +| ↳ `national_team` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_venues` + +Retrieve all motorsport venues (racing tracks) from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue \(racing track\) objects | +| ↳ `id` | number | Unique id of the venue \(track\) | +| ↳ `country_id` | number | Country the venue is in | +| ↳ `city_id` | number | City the venue is in | +| ↳ `name` | string | Name of the venue/track | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Capacity of the venue | +| ↳ `image_path` | string | URL to the track layout image | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface of the venue | +| ↳ `national_team` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_get_venues_by_season` + +Retrieve all motorsport venues (racing tracks) for a season by season ID from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `seasonId` | string | Yes | The unique id of the season | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue \(racing track\) objects for the season | +| ↳ `id` | number | Unique id of the venue \(track\) | +| ↳ `country_id` | number | Country the venue is in | +| ↳ `city_id` | number | City the venue is in | +| ↳ `name` | string | Name of the venue/track | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Capacity of the venue | +| ↳ `image_path` | string | URL to the track layout image | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface of the venue | +| ↳ `national_team` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_search_drivers` + +Search for motorsport drivers by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The driver name to search for \(e.g. Verstappen\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `drivers` | array | Array of driver objects matching the search query | +| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | +| ↳ `sport_id` | number | Sport of the driver | +| ↳ `country_id` | number | Country of birth of the driver | +| ↳ `nationality_id` | number | Nationality of the driver | +| ↳ `city_id` | number | City of birth of the driver | +| ↳ `position_id` | number | Position of the driver within the team | +| ↳ `detailed_position_id` | number | Not used in the Motorsport API | +| ↳ `type_id` | number | Not used in the Motorsport API | +| ↳ `common_name` | string | Name the driver is known for | +| ↳ `firstname` | string | First name of the driver | +| ↳ `lastname` | string | Last name of the driver | +| ↳ `name` | string | Name of the driver | +| ↳ `display_name` | string | Display name of the driver | +| ↳ `image_path` | string | URL to the driver headshot | +| ↳ `height` | number | Height of the driver in cm | +| ↳ `weight` | number | Weight of the driver in kg | +| ↳ `date_of_birth` | string | Date of birth of the driver | +| ↳ `gender` | string | Gender of the driver | + +### `sportmonks_motorsport_search_leagues` + +Search for motorsport leagues by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The league name to search for \(e.g. Formula\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;seasons\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `leagues` | array | Array of league objects matching the search query | +| ↳ `id` | number | Unique id of the league | +| ↳ `sport_id` | number | Sport of the league | +| ↳ `country_id` | number | Country of the league | +| ↳ `name` | string | Name of the league | +| ↳ `active` | boolean | Whether the league is active | +| ↳ `short_code` | string | Short code of the league | +| ↳ `image_path` | string | URL to the league logo | +| ↳ `type` | string | Type of the league | +| ↳ `sub_type` | string | Subtype of the league | +| ↳ `last_played_at` | string | Date of the last fixture held in the league | +| ↳ `category` | number | Category of the league | +| ↳ `has_jerseys` | boolean | Not used in the Motorsport API | + +### `sportmonks_motorsport_search_stages` + +Search for motorsport stages (race weekends) by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The stage name to search for \(e.g. Monaco\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. league;season;fixtures\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `stages` | array | Array of stage \(race weekend\) objects matching the search query | +| ↳ `id` | number | Unique id of the stage \(race weekend\) | +| ↳ `sport_id` | number | Sport of the stage | +| ↳ `league_id` | number | League related to the stage | +| ↳ `season_id` | number | Season related to the stage | +| ↳ `type_id` | number | Type of the stage | +| ↳ `name` | string | Name of the stage | +| ↳ `sort_order` | number | Order of the stage | +| ↳ `finished` | boolean | Whether the stage is finished | +| ↳ `is_current` | boolean | Whether the stage is the current stage | +| ↳ `starting_at` | string | Starting date of the stage | +| ↳ `ending_at` | string | Ending date of the stage | +| ↳ `games_in_current_week` | boolean | Not used in the Motorsport API | +| ↳ `tie_breaker_rule_id` | number | Not used in the Motorsport API | + +### `sportmonks_motorsport_search_teams` + +Search for motorsport teams (constructors) by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The team name to search for \(e.g. Bull\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `teams` | array | Array of team \(constructor\) objects matching the search query | +| ↳ `id` | number | Unique id of the team | +| ↳ `sport_id` | number | Sport of the team | +| ↳ `country_id` | number | Country of the team | +| ↳ `venue_id` | number | Not used in the Motorsport API | +| ↳ `gender` | string | Gender of the team | +| ↳ `name` | string | Name of the team \(constructor\) | +| ↳ `short_code` | string | Short code of the team | +| ↳ `image_path` | string | URL to the team logo | +| ↳ `founded` | number | Founding year of the team | +| ↳ `type` | string | Type of the team | +| ↳ `placeholder` | boolean | Whether the team is a placeholder | +| ↳ `last_played_at` | string | Date and time of the team's last session | + +### `sportmonks_motorsport_search_venues` + +Search for motorsport venues (racing tracks) by name from Sportmonks + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The venue name to search for \(e.g. Hungaroring\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;city\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `venues` | array | Array of venue \(racing track\) objects matching the search query | +| ↳ `id` | number | Unique id of the venue \(track\) | +| ↳ `country_id` | number | Country the venue is in | +| ↳ `city_id` | number | City the venue is in | +| ↳ `name` | string | Name of the venue/track | +| ↳ `address` | string | Address of the venue | +| ↳ `zipcode` | string | Zipcode of the venue | +| ↳ `latitude` | string | Latitude of the venue | +| ↳ `longitude` | string | Longitude of the venue | +| ↳ `capacity` | number | Capacity of the venue | +| ↳ `image_path` | string | URL to the track layout image | +| ↳ `city_name` | string | Name of the city the venue is in | +| ↳ `surface` | string | Surface of the venue | +| ↳ `national_team` | boolean | Not used in the Motorsport API | + +### `sportmonks_odds_get_all_historical_odds` + +Retrieve all available historical (premium) pre-match odd values from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. odd\) | +| `filters` | string | No | Filters to apply \(e.g. winningOdds\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `historicalOdds` | array | Array of historical premium odd value records | +| ↳ `id` | number | Unique id of the history record | +| ↳ `odd_id` | number | Premium odd this history record belongs to | +| ↳ `value` | string | Historical decimal odds value | +| ↳ `probability` | string | Implied probability at this point in time | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `bookmaker_update` | string | Bookmaker's update timestamp for this record \(UTC\) | + +### `sportmonks_odds_get_all_inplay_odds` + +Retrieve all available live (in-play) odds from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12, bookmakers:2,14, IdAfter:oddID\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of in-play odd objects | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `external_id` | number | External id of the odd | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `suspended` | boolean | Whether the odd is suspended | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | + +### `sportmonks_odds_get_all_pre_match_odds` + +Retrieve all available pre-match odds from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12, bookmakers:2,14, winningOdds, IdAfter:oddID\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of pre-match odd objects | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | +| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `original_label` | string | Original handicap value of the odd \(handicap markets\) | + +### `sportmonks_odds_get_all_premium_odds` + +Retrieve all available premium (historical) pre-match odds from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12, bookmakers:2,14, IdAfter:oddID\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `premiumOdds` | array | Array of premium odd objects | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 29.85%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `created_at` | string | Timestamp the odd was created \(UTC\) | +| ↳ `updated_at` | string | Timestamp the odd was last updated \(UTC\) | +| ↳ `latest_bookmaker_update` | string | Bookmaker's own last-update timestamp \(UTC\) | + +### `sportmonks_odds_get_bookmaker` + +Retrieve a single bookmaker by its ID from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `bookmakerId` | string | Yes | The unique id of the bookmaker | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `bookmaker` | object | The requested bookmaker object | +| ↳ `id` | number | Unique id of the bookmaker | +| ↳ `name` | string | Name of the bookmaker | +| ↳ `logo` | string | Logo of the bookmaker | + +### `sportmonks_odds_get_bookmaker_event_ids_by_fixture` + +Retrieve bookmakers' own event ids mapped to a Sportmonks fixture via the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `driver` | object | The requested driver object | -| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | -| ↳ `sport_id` | number | Sport of the driver | -| ↳ `country_id` | number | Country of birth of the driver | -| ↳ `nationality_id` | number | Nationality of the driver | -| ↳ `city_id` | number | City of birth of the driver | -| ↳ `position_id` | number | Position of the driver within the team | -| ↳ `detailed_position_id` | number | Not used in the Motorsport API | -| ↳ `type_id` | number | Not used in the Motorsport API | -| ↳ `common_name` | string | Name the driver is known for | -| ↳ `firstname` | string | First name of the driver | -| ↳ `lastname` | string | Last name of the driver | -| ↳ `name` | string | Name of the driver | -| ↳ `display_name` | string | Display name of the driver | -| ↳ `image_path` | string | URL to the driver headshot | -| ↳ `height` | number | Height of the driver in cm | -| ↳ `weight` | number | Weight of the driver in kg | -| ↳ `date_of_birth` | string | Date of birth of the driver | -| ↳ `gender` | string | Gender of the driver | +| `bookmakerEvents` | array | Array of bookmaker event mapping records for the fixture | +| ↳ `fixture_id` | number | Sportmonks fixture id | +| ↳ `bookmaker_id` | number | Id of the bookmaker | +| ↳ `bookmaker_name` | string | Name of the bookmaker | +| ↳ `bookmaker_event_id` | string | The fixture's event id at the bookmaker | -### `sportmonks_motorsport_search_drivers` +### `sportmonks_odds_get_bookmakers` -Search for motorsport drivers by name from Sportmonks +Retrieve all bookmakers from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The driver name to search for \(e.g. Verstappen\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;teams\) | +| `filters` | string | No | Filters to apply \(e.g. IdAfter:bookmakerID\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | | `order` | string | No | Order direction \(asc or desc\) | @@ -772,102 +6003,286 @@ Search for motorsport drivers by name from Sportmonks | Parameter | Type | Description | | --------- | ---- | ----------- | -| `drivers` | array | Array of driver objects matching the search query | -| ↳ `id` | number | Unique id of the driver \(player_id in responses\) | -| ↳ `sport_id` | number | Sport of the driver | -| ↳ `country_id` | number | Country of birth of the driver | -| ↳ `nationality_id` | number | Nationality of the driver | -| ↳ `city_id` | number | City of birth of the driver | -| ↳ `position_id` | number | Position of the driver within the team | -| ↳ `detailed_position_id` | number | Not used in the Motorsport API | -| ↳ `type_id` | number | Not used in the Motorsport API | -| ↳ `common_name` | string | Name the driver is known for | -| ↳ `firstname` | string | First name of the driver | -| ↳ `lastname` | string | Last name of the driver | -| ↳ `name` | string | Name of the driver | -| ↳ `display_name` | string | Display name of the driver | -| ↳ `image_path` | string | URL to the driver headshot | -| ↳ `height` | number | Height of the driver in cm | -| ↳ `weight` | number | Weight of the driver in kg | -| ↳ `date_of_birth` | string | Date of birth of the driver | -| ↳ `gender` | string | Gender of the driver | +| `bookmakers` | array | Array of bookmaker objects | +| ↳ `id` | number | Unique id of the bookmaker | +| ↳ `name` | string | Name of the bookmaker | +| ↳ `logo` | string | Logo of the bookmaker | + +### `sportmonks_odds_get_bookmakers_by_fixture` + +Retrieve all bookmakers available for a fixture from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `bookmakers` | array | Array of bookmaker objects available for the fixture | +| ↳ `id` | number | Unique id of the bookmaker | +| ↳ `name` | string | Name of the bookmaker | +| ↳ `logo` | string | Logo of the bookmaker | + +### `sportmonks_odds_get_inplay_odds_by_fixture` + +Retrieve live (in-play) odds for a fixture by fixture ID from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14 or winningOdds\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of in-play odd objects for the fixture | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `external_id` | number | External id of the odd | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `suspended` | boolean | Whether the odd is suspended | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | + +### `sportmonks_odds_get_inplay_odds_by_fixture_and_bookmaker` + +Retrieve live (in-play) odds for a fixture from a specific bookmaker via the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `bookmakerId` | string | Yes | The unique id of the bookmaker | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of in-play odd objects for the fixture and bookmaker | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `external_id` | number | External id of the odd | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `suspended` | boolean | Whether the odd is suspended | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | + +### `sportmonks_odds_get_inplay_odds_by_fixture_and_market` + +Retrieve live (in-play) odds for a fixture on a specific market via the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `marketId` | string | Yes | The unique id of the market | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. bookmakers:2,14\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of in-play odd objects for the fixture and market | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `external_id` | number | External id of the odd | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `suspended` | boolean | Whether the odd is suspended | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | + +### `sportmonks_odds_get_last_updated_inplay_odds` + +Retrieve in-play odds updated in the last 10 seconds from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of in-play odd objects updated in the last 10 seconds | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `external_id` | number | External id of the odd | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `suspended` | boolean | Whether the odd is suspended | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | + +### `sportmonks_odds_get_last_updated_pre_match_odds` + +Retrieve pre-match odds updated in the last 10 seconds from the Sportmonks Odds API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14 or winningOdds\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `odds` | array | Array of pre-match odd objects updated in the last 10 seconds | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | +| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `original_label` | string | Original handicap value of the odd \(handicap markets\) | -### `sportmonks_motorsport_get_teams` +### `sportmonks_odds_get_market` -Retrieve all motorsport teams (constructors) from Sportmonks +Retrieve a single betting market by its ID from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | -| `filters` | string | No | Filters to apply | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | +| `marketId` | string | Yes | The unique id of the market | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `teams` | array | Array of team \(constructor\) objects | -| ↳ `id` | number | Unique id of the team | -| ↳ `sport_id` | number | Sport of the team | -| ↳ `country_id` | number | Country of the team | -| ↳ `venue_id` | number | Not used in the Motorsport API | -| ↳ `gender` | string | Gender of the team | -| ↳ `name` | string | Name of the team \(constructor\) | -| ↳ `short_code` | string | Short code of the team | -| ↳ `image_path` | string | URL to the team logo | -| ↳ `founded` | number | Founding year of the team | -| ↳ `type` | string | Type of the team | -| ↳ `placeholder` | boolean | Whether the team is a placeholder | -| ↳ `last_played_at` | string | Date and time of the team's last session | +| `market` | object | The requested market object | +| ↳ `id` | number | Unique id of the market | +| ↳ `name` | string | Name of the market | +| ↳ `developer_name` | string | Developer \(machine-readable\) name of the market | -### `sportmonks_motorsport_get_team` +### `sportmonks_odds_get_markets` -Retrieve a single motorsport team (constructor) by its ID from Sportmonks +Retrieve all betting markets from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `teamId` | string | Yes | The unique id of the team \(constructor\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;drivers\) | -| `filters` | string | No | Filters to apply | +| `filters` | string | No | Filters to apply \(e.g. IdAfter:marketID\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `team` | object | The requested team \(constructor\) object | -| ↳ `id` | number | Unique id of the team | -| ↳ `sport_id` | number | Sport of the team | -| ↳ `country_id` | number | Country of the team | -| ↳ `venue_id` | number | Not used in the Motorsport API | -| ↳ `gender` | string | Gender of the team | -| ↳ `name` | string | Name of the team \(constructor\) | -| ↳ `short_code` | string | Short code of the team | -| ↳ `image_path` | string | URL to the team logo | -| ↳ `founded` | number | Founding year of the team | -| ↳ `type` | string | Type of the team | -| ↳ `placeholder` | boolean | Whether the team is a placeholder | -| ↳ `last_played_at` | string | Date and time of the team's last session | +| `markets` | array | Array of market objects | +| ↳ `id` | number | Unique id of the market | +| ↳ `name` | string | Name of the market | +| ↳ `developer_name` | string | Developer \(machine-readable\) name of the market | -### `sportmonks_motorsport_get_driver_standings_by_season` +### `sportmonks_odds_get_pre_match_odds_by_fixture` -Retrieve the drivers championship standings for a season by season ID from Sportmonks +Retrieve pre-match odds for a fixture by fixture ID from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `seasonId` | string | Yes | The unique id of the season | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | -| `filters` | string | No | Filters to apply | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14 or winningOdds\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | | `order` | string | No | Order direction \(asc or desc\) | @@ -876,107 +6291,146 @@ Retrieve the drivers championship standings for a season by season ID from Sport | Parameter | Type | Description | | --------- | ---- | ----------- | -| `standings` | array | Array of driver standing entries for the season | -| ↳ `id` | number | Unique id of the standing | -| ↳ `participant_id` | number | Driver or team related to the standing | -| ↳ `sport_id` | number | Sport related to the standing | -| ↳ `league_id` | number | League related to the standing | -| ↳ `season_id` | number | Season related to the standing | -| ↳ `stage_id` | number | Stage related to the standing | -| ↳ `group_id` | number | Not used in the Motorsport API | -| ↳ `round_id` | number | Not used in the Motorsport API | -| ↳ `standing_rule_id` | number | Not used in the Motorsport API | -| ↳ `position` | number | Position of the participant in the standing | -| ↳ `result` | string | Not used in the Motorsport API | -| ↳ `points` | number | Points the participant has gathered | +| `odds` | array | Array of pre-match odd objects for the fixture | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | +| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `original_label` | string | Original handicap value of the odd \(handicap markets\) | -### `sportmonks_motorsport_get_team_standings_by_season` +### `sportmonks_odds_get_pre_match_odds_by_fixture_and_bookmaker` -Retrieve the constructors championship standings for a season by season ID from Sportmonks +Retrieve pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `seasonId` | string | Yes | The unique id of the season | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;season\) | -| `filters` | string | No | Filters to apply | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `bookmakerId` | string | Yes | The unique id of the bookmaker | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or winningOdds\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `standings` | array | Array of team \(constructor\) standing entries for the season | -| ↳ `id` | number | Unique id of the standing | -| ↳ `participant_id` | number | Driver or team related to the standing | -| ↳ `sport_id` | number | Sport related to the standing | -| ↳ `league_id` | number | League related to the standing | -| ↳ `season_id` | number | Season related to the standing | -| ↳ `stage_id` | number | Stage related to the standing | -| ↳ `group_id` | number | Not used in the Motorsport API | -| ↳ `round_id` | number | Not used in the Motorsport API | -| ↳ `standing_rule_id` | number | Not used in the Motorsport API | -| ↳ `position` | number | Position of the participant in the standing | -| ↳ `result` | string | Not used in the Motorsport API | -| ↳ `points` | number | Points the participant has gathered | +| `odds` | array | Array of pre-match odd objects for the fixture and bookmaker | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | +| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `original_label` | string | Original handicap value of the odd \(handicap markets\) | -### `sportmonks_motorsport_get_laps_by_fixture` +### `sportmonks_odds_get_pre_match_odds_by_fixture_and_market` -Retrieve all laps for a motorsport fixture (session) by fixture ID from Sportmonks +Retrieve pre-match odds for a fixture on a specific market via the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | -| `filters` | string | No | Filters to apply | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `marketId` | string | Yes | The unique id of the market | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. bookmakers:2,14 or winningOdds\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `laps` | array | Array of lap objects for the fixture | -| ↳ `id` | number | Unique id of the lap/pitstop | -| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | -| ↳ `lap_number` | number | Lap number in the fixture | -| ↳ `driver_number` | number | Number of the driver | -| ↳ `participant_id` | number | Driver related to the lap/pitstop | -| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | +| `odds` | array | Array of pre-match odd objects for the fixture and market | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | +| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | +| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `original_label` | string | Original handicap value of the odd \(handicap markets\) | -### `sportmonks_motorsport_get_pitstops_by_fixture` +### `sportmonks_odds_get_premium_odds_by_fixture` -Retrieve all pitstops for a motorsport fixture (session) by fixture ID from Sportmonks +Retrieve premium (historical) pre-match odds for a fixture from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `fixtureId` | string | Yes | The unique id of the fixture \(session\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. participant;details\) | -| `filters` | string | No | Filters to apply | +| `fixtureId` | string | Yes | The unique id of the fixture | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `pitstops` | array | Array of pitstop objects for the fixture | -| ↳ `id` | number | Unique id of the lap/pitstop | -| ↳ `fixture_id` | number | Fixture related to the lap/pitstop | -| ↳ `lap_number` | number | Lap number in the fixture | -| ↳ `driver_number` | number | Number of the driver | -| ↳ `participant_id` | number | Driver related to the lap/pitstop | -| ↳ `is_latest` | boolean | Whether it is the latest lap/pitstop | +| `premiumOdds` | array | Array of premium odd objects for the fixture | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 29.85%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `created_at` | string | Timestamp the odd was created \(UTC\) | +| ↳ `updated_at` | string | Timestamp the odd was last updated \(UTC\) | +| ↳ `latest_bookmaker_update` | string | Bookmaker's own last-update timestamp \(UTC\) | -### `sportmonks_odds_get_pre_match_odds_by_fixture` +### `sportmonks_odds_get_premium_odds_by_fixture_and_bookmaker` -Retrieve pre-match odds for a fixture by fixture ID from the Sportmonks Odds API +Retrieve premium pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API #### Input @@ -984,39 +6438,38 @@ Retrieve pre-match odds for a fixture by fixture ID from the Sportmonks Odds API | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | | `fixtureId` | string | Yes | The unique id of the fixture | +| `bookmakerId` | string | Yes | The unique id of the bookmaker | | `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | -| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14 or winningOdds\) | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `odds` | array | Array of pre-match odd objects for the fixture | +| `premiumOdds` | array | Array of premium odd objects for the fixture and bookmaker | | ↳ `id` | number | Unique id of the odd | | ↳ `fixture_id` | number | Fixture the odd belongs to | | ↳ `market_id` | number | Market the odd belongs to | | ↳ `bookmaker_id` | number | Bookmaker offering the odd | -| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `label` | string | Outcome label | | ↳ `value` | string | Decimal odds value | -| ↳ `name` | string | Outcome name \(e.g. Home, Draw, Away\) | +| ↳ `name` | string | Outcome name | | ↳ `sort_order` | number | Sort order of the odd | | ↳ `market_description` | string | Description of the market | -| ↳ `probability` | string | Implied probability \(e.g. 48.78%\) | +| ↳ `probability` | string | Implied probability \(e.g. 29.85%\) | | ↳ `dp3` | string | Decimal odds to 3 decimal places | -| ↳ `fractional` | string | Fractional odds \(e.g. 31/15\) | -| ↳ `american` | string | American/moneyline odds \(e.g. +104\) | -| ↳ `winning` | boolean | Whether this is the winning outcome | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | | ↳ `stopped` | boolean | Whether the odd is stopped | | ↳ `total` | string | Total line for over/under markets | | ↳ `handicap` | string | Handicap line for handicap markets | -| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `created_at` | string | Timestamp the odd was created \(UTC\) | +| ↳ `updated_at` | string | Timestamp the odd was last updated \(UTC\) | +| ↳ `latest_bookmaker_update` | string | Bookmaker's own last-update timestamp \(UTC\) | -### `sportmonks_odds_get_inplay_odds_by_fixture` +### `sportmonks_odds_get_premium_odds_by_fixture_and_market` -Retrieve live (in-play) odds for a fixture by fixture ID from the Sportmonks Odds API +Retrieve premium pre-match odds for a fixture on a specific market via the Sportmonks Odds API #### Input @@ -1024,48 +6477,48 @@ Retrieve live (in-play) odds for a fixture by fixture ID from the Sportmonks Odd | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | | `fixtureId` | string | Yes | The unique id of the fixture | +| `marketId` | string | Yes | The unique id of the market | | `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | -| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14 or winningOdds\) | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | +| `filters` | string | No | Filters to apply \(e.g. bookmakers:2,14\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `odds` | array | Array of in-play odd objects for the fixture | +| `premiumOdds` | array | Array of premium odd objects for the fixture and market | | ↳ `id` | number | Unique id of the odd | | ↳ `fixture_id` | number | Fixture the odd belongs to | -| ↳ `external_id` | number | External id of the odd | | ↳ `market_id` | number | Market the odd belongs to | | ↳ `bookmaker_id` | number | Bookmaker offering the odd | -| ↳ `label` | string | Outcome label \(e.g. 1, X, 2\) | +| ↳ `label` | string | Outcome label | | ↳ `value` | string | Decimal odds value | | ↳ `name` | string | Outcome name | | ↳ `sort_order` | number | Sort order of the odd | | ↳ `market_description` | string | Description of the market | -| ↳ `probability` | string | Implied probability | +| ↳ `probability` | string | Implied probability \(e.g. 29.85%\) | | ↳ `dp3` | string | Decimal odds to 3 decimal places | | ↳ `fractional` | string | Fractional odds | | ↳ `american` | string | American/moneyline odds | -| ↳ `winning` | boolean | Whether this is the winning outcome | -| ↳ `suspended` | boolean | Whether the odd is suspended | | ↳ `stopped` | boolean | Whether the odd is stopped | | ↳ `total` | string | Total line for over/under markets | | ↳ `handicap` | string | Handicap line for handicap markets | -| ↳ `participants` | string | Participant ids related to the outcome | +| ↳ `created_at` | string | Timestamp the odd was created \(UTC\) | +| ↳ `updated_at` | string | Timestamp the odd was last updated \(UTC\) | +| ↳ `latest_bookmaker_update` | string | Bookmaker's own last-update timestamp \(UTC\) | -### `sportmonks_odds_get_bookmakers` +### `sportmonks_odds_get_updated_historical_odds_between` -Retrieve all bookmakers from the Sportmonks Odds API +Retrieve historical (premium) odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `filters` | string | No | Filters to apply \(e.g. IdAfter:bookmakerID\) | +| `fromTimestamp` | string | Yes | Start of the range as a UNIX timestamp \(e.g. 1767225600\) | +| `toTimestamp` | string | Yes | End of the range as a UNIX timestamp \(max 5 minutes after the start\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. odd\) | +| `filters` | string | No | Filters to apply \(e.g. winningOdds\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | | `order` | string | No | Order direction \(asc or desc\) | @@ -1074,30 +6527,57 @@ Retrieve all bookmakers from the Sportmonks Odds API | Parameter | Type | Description | | --------- | ---- | ----------- | -| `bookmakers` | array | Array of bookmaker objects | -| ↳ `id` | number | Unique id of the bookmaker | -| ↳ `name` | string | Name of the bookmaker | -| ↳ `logo` | string | Logo of the bookmaker | +| `historicalOdds` | array | Array of historical premium odd value records updated within the time range | +| ↳ `id` | number | Unique id of the history record | +| ↳ `odd_id` | number | Premium odd this history record belongs to | +| ↳ `value` | string | Historical decimal odds value | +| ↳ `probability` | string | Implied probability at this point in time | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `bookmaker_update` | string | Bookmaker's update timestamp for this record \(UTC\) | -### `sportmonks_odds_get_bookmaker` +### `sportmonks_odds_get_updated_premium_odds_between` -Retrieve a single bookmaker by its ID from the Sportmonks Odds API +Retrieve premium odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `bookmakerId` | string | Yes | The unique id of the bookmaker | +| `fromTimestamp` | string | Yes | Start of the range as a UNIX timestamp \(e.g. 1767225600\) | +| `toTimestamp` | string | Yes | End of the range as a UNIX timestamp \(max 5 minutes after the start\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. market;bookmaker\) | +| `filters` | string | No | Filters to apply \(e.g. markets:1,12 or bookmakers:2,14\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `bookmaker` | object | The requested bookmaker object | -| ↳ `id` | number | Unique id of the bookmaker | -| ↳ `name` | string | Name of the bookmaker | -| ↳ `logo` | string | Logo of the bookmaker | +| `premiumOdds` | array | Array of premium odd objects updated within the time range | +| ↳ `id` | number | Unique id of the odd | +| ↳ `fixture_id` | number | Fixture the odd belongs to | +| ↳ `market_id` | number | Market the odd belongs to | +| ↳ `bookmaker_id` | number | Bookmaker offering the odd | +| ↳ `label` | string | Outcome label | +| ↳ `value` | string | Decimal odds value | +| ↳ `name` | string | Outcome name | +| ↳ `sort_order` | number | Sort order of the odd | +| ↳ `market_description` | string | Description of the market | +| ↳ `probability` | string | Implied probability \(e.g. 29.85%\) | +| ↳ `dp3` | string | Decimal odds to 3 decimal places | +| ↳ `fractional` | string | Fractional odds | +| ↳ `american` | string | American/moneyline odds | +| ↳ `stopped` | boolean | Whether the odd is stopped | +| ↳ `total` | string | Total line for over/under markets | +| ↳ `handicap` | string | Handicap line for handicap markets | +| ↳ `created_at` | string | Timestamp the odd was created \(UTC\) | +| ↳ `updated_at` | string | Timestamp the odd was last updated \(UTC\) | +| ↳ `latest_bookmaker_update` | string | Bookmaker's own last-update timestamp \(UTC\) | ### `sportmonks_odds_search_bookmakers` @@ -1111,6 +6591,7 @@ Search for bookmakers by name from the Sportmonks Odds API | `query` | string | Yes | The bookmaker name to search for \(e.g. bet365\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output @@ -1121,16 +6602,16 @@ Search for bookmakers by name from the Sportmonks Odds API | ↳ `name` | string | Name of the bookmaker | | ↳ `logo` | string | Logo of the bookmaker | -### `sportmonks_odds_get_markets` +### `sportmonks_odds_search_markets` -Retrieve all betting markets from the Sportmonks Odds API +Search for betting markets by name from the Sportmonks Odds API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `filters` | string | No | Filters to apply \(e.g. IdAfter:marketID\) | +| `query` | string | Yes | The market name to search for \(e.g. Over/Under\) | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | | `order` | string | No | Order direction \(asc or desc\) | @@ -1139,91 +6620,104 @@ Retrieve all betting markets from the Sportmonks Odds API | Parameter | Type | Description | | --------- | ---- | ----------- | -| `markets` | array | Array of market objects | +| `markets` | array | Array of market objects matching the search query | | ↳ `id` | number | Unique id of the market | | ↳ `name` | string | Name of the market | +| ↳ `developer_name` | string | Developer \(machine-readable\) name of the market | -### `sportmonks_odds_get_market` +### `sportmonks_core_get_cities` -Retrieve a single betting market by its ID from the Sportmonks Odds API +Retrieve all cities from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `marketId` | string | Yes | The unique id of the market | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `market` | object | The requested market object | -| ↳ `id` | number | Unique id of the market | -| ↳ `name` | string | Name of the market | +| `cities` | array | Array of city objects | +| ↳ `id` | number | Unique id of the city | +| ↳ `country_id` | number | Country of the city | +| ↳ `region_id` | number | Region id of the city | +| ↳ `name` | string | Name of the city | +| ↳ `latitude` | string | Latitude of the city | +| ↳ `longitude` | string | Longitude of the city | +| ↳ `geonameid` | number | Official geonameid of the city | -### `sportmonks_odds_search_markets` +### `sportmonks_core_get_city` -Search for betting markets by name from the Sportmonks Odds API +Retrieve a single city by its ID from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The market name to search for \(e.g. Over/Under\) | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | +| `cityId` | string | Yes | The unique id of the city | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `markets` | array | Array of market objects matching the search query | -| ↳ `id` | number | Unique id of the market | -| ↳ `name` | string | Name of the market | +| `city` | object | The requested city object | +| ↳ `id` | number | Unique id of the city | +| ↳ `country_id` | number | Country of the city | +| ↳ `region_id` | number | Region id of the city | +| ↳ `name` | string | Name of the city | +| ↳ `latitude` | string | Latitude of the city | +| ↳ `longitude` | string | Longitude of the city | +| ↳ `geonameid` | number | Official geonameid of the city | -### `sportmonks_core_get_continents` +### `sportmonks_core_get_continent` -Retrieve all continents from the Sportmonks Core API +Retrieve a single continent by its ID from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | +| `continentId` | string | Yes | The unique id of the continent | | `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. countries\) | -| `filters` | string | No | Filters to apply | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | -| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `continents` | array | Array of continent objects | +| `continent` | object | The requested continent object | | ↳ `id` | number | Unique id of the continent | | ↳ `name` | string | Name of the continent | | ↳ `code` | string | Short code of the continent | -### `sportmonks_core_get_continent` +### `sportmonks_core_get_continents` -Retrieve a single continent by its ID from the Sportmonks Core API +Retrieve all continents from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `continentId` | string | Yes | The unique id of the continent | | `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. countries\) | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `continent` | object | The requested continent object | +| `continents` | array | Array of continent objects | | ↳ `id` | number | Unique id of the continent | | ↳ `name` | string | Name of the continent | | ↳ `code` | string | Short code of the continent | @@ -1291,49 +6785,31 @@ Retrieve a single country by its ID from the Sportmonks Core API | ↳ `borders` | array | Neighbouring countries \(ISO3 codes\) | | ↳ `image_path` | string | Image path to the country flag | -### `sportmonks_core_search_countries` +### `sportmonks_core_get_entity_filters` -Search for countries by name from the Sportmonks Core API +Retrieve all available filters grouped per entity from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The country name to search for \(e.g. Brazil\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. continent\) | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `countries` | array | Array of country objects matching the search query | -| ↳ `id` | number | Unique id of the country | -| ↳ `continent_id` | number | Continent of the country | -| ↳ `name` | string | Name of the country | -| ↳ `official_name` | string | Official name of the country | -| ↳ `fifa_name` | string | Official FIFA short code name | -| ↳ `iso2` | string | Two letter country code | -| ↳ `iso3` | string | Three letter country code | -| ↳ `latitude` | string | Latitude position of the country | -| ↳ `longitude` | string | Longitude position of the country | -| ↳ `geonameid` | number | Official geonameid | -| ↳ `borders` | array | Neighbouring countries \(ISO3 codes\) | -| ↳ `image_path` | string | Image path to the country flag | +| `entityFilters` | json | Map of entity name to its available filter names, e.g. \{fixture: \["fixtureLeagues", "fixtureSeasons"\], event: \["eventTypes"\]\} | -### `sportmonks_core_get_regions` +### `sportmonks_core_get_my_usage` -Retrieve all regions from the Sportmonks Core API +Retrieve your Sportmonks API usage aggregated per 5 minutes #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;cities\) | -| `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | | `order` | string | No | Order direction \(asc or desc\) | @@ -1342,10 +6818,14 @@ Retrieve all regions from the Sportmonks Core API | Parameter | Type | Description | | --------- | ---- | ----------- | -| `regions` | array | Array of region objects | -| ↳ `id` | number | Unique id of the region | -| ↳ `country_id` | number | Country of the region | -| ↳ `name` | string | Name of the region | +| `usage` | array | Array of API usage records aggregated per 5-minute period | +| ↳ `id` | number | Identifier of the usage record | +| ↳ `endpoint` | string | Identifier of the requested endpoint | +| ↳ `count` | number | Total calls for the given timeframe | +| ↳ `entity` | string | The entity the rate limit applies on | +| ↳ `remaining_requests` | number | Amount of requests remaining for the entity in the hourly rate limit | +| ↳ `period_start` | number | Timestamp representing the aggregation start time | +| ↳ `period_end` | number | Timestamp representing the aggregation end time | ### `sportmonks_core_get_region` @@ -1368,16 +6848,16 @@ Retrieve a single region by its ID from the Sportmonks Core API | ↳ `country_id` | number | Country of the region | | ↳ `name` | string | Name of the region | -### `sportmonks_core_get_cities` +### `sportmonks_core_get_regions` -Retrieve all cities from the Sportmonks Core API +Retrieve all regions from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;cities\) | | `filters` | string | No | Filters to apply | | `per_page` | string | No | Number of results per page \(max 50, default 25\) | | `page` | string | No | Page number to retrieve | @@ -1387,66 +6867,66 @@ Retrieve all cities from the Sportmonks Core API | Parameter | Type | Description | | --------- | ---- | ----------- | -| `cities` | array | Array of city objects | -| ↳ `id` | number | Unique id of the city | -| ↳ `country_id` | number | Country of the city | -| ↳ `region` | number | Region of the city | -| ↳ `name` | string | Name of the city | -| ↳ `latitude` | string | Latitude of the city | -| ↳ `longitude` | string | Longitude of the city | -| ↳ `geonameid` | number | Official geonameid of the city | +| `regions` | array | Array of region objects | +| ↳ `id` | number | Unique id of the region | +| ↳ `country_id` | number | Country of the region | +| ↳ `name` | string | Name of the region | -### `sportmonks_core_get_city` +### `sportmonks_core_get_timezones` -Retrieve a single city by its ID from the Sportmonks Core API +Retrieve all supported time zones (IANA names) from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `cityId` | string | Yes | The unique id of the city | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `city` | object | The requested city object | -| ↳ `id` | number | Unique id of the city | -| ↳ `country_id` | number | Country of the city | -| ↳ `region` | number | Region of the city | -| ↳ `name` | string | Name of the city | -| ↳ `latitude` | string | Latitude of the city | -| ↳ `longitude` | string | Longitude of the city | -| ↳ `geonameid` | number | Official geonameid of the city | +| `timezones` | array | Array of supported IANA time zone names \(e.g. Europe/London\) | -### `sportmonks_core_search_cities` +### `sportmonks_core_get_type` -Search for cities by name from the Sportmonks Core API +Retrieve a single type by its ID from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `query` | string | Yes | The city name to search for \(e.g. London\) | -| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | -| `per_page` | string | No | Number of results per page \(max 50, default 25\) | -| `page` | string | No | Page number to retrieve | +| `typeId` | string | Yes | The unique id of the type | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `cities` | array | Array of city objects matching the search query | -| ↳ `id` | number | Unique id of the city | -| ↳ `country_id` | number | Country of the city | -| ↳ `region` | number | Region of the city | -| ↳ `name` | string | Name of the city | -| ↳ `latitude` | string | Latitude of the city | -| ↳ `longitude` | string | Longitude of the city | -| ↳ `geonameid` | number | Official geonameid of the city | +| `type` | object | The requested type object | +| ↳ `id` | number | Unique id of the type | +| ↳ `parent_id` | number | Parent type of the type | +| ↳ `name` | string | Name of the type | +| ↳ `code` | string | Code of the type | +| ↳ `developer_name` | string | Developer name of the type | +| ↳ `group` | string | Group the type falls under | +| ↳ `description` | string | Description of the type | + +### `sportmonks_core_get_type_by_entity` + +Retrieve the available types grouped per entity from the Sportmonks Core API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `typesByEntity` | json | Map of entity name to its available types, e.g. \{CoachStatisticDetail: \{updated_at, types: \[\{id, name, code, developer_name, model_type, stat_group\}\]\}\} | ### `sportmonks_core_get_types` @@ -1474,44 +6954,92 @@ Retrieve all types (reference data describing events, statistics, positions, etc | ↳ `group` | string | Group the type falls under | | ↳ `description` | string | Description of the type | -### `sportmonks_core_get_type` +### `sportmonks_core_search_cities` -Retrieve a single type by its ID from the Sportmonks Core API +Search for cities by name from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | -| `typeId` | string | Yes | The unique id of the type | +| `query` | string | Yes | The city name to search for \(e.g. London\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. region\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `type` | object | The requested type object | -| ↳ `id` | number | Unique id of the type | -| ↳ `parent_id` | number | Parent type of the type | -| ↳ `name` | string | Name of the type | -| ↳ `code` | string | Code of the type | -| ↳ `developer_name` | string | Developer name of the type | -| ↳ `group` | string | Group the type falls under | -| ↳ `description` | string | Description of the type | +| `cities` | array | Array of city objects matching the search query | +| ↳ `id` | number | Unique id of the city | +| ↳ `country_id` | number | Country of the city | +| ↳ `region_id` | number | Region id of the city | +| ↳ `name` | string | Name of the city | +| ↳ `latitude` | string | Latitude of the city | +| ↳ `longitude` | string | Longitude of the city | +| ↳ `geonameid` | number | Official geonameid of the city | -### `sportmonks_core_get_timezones` +### `sportmonks_core_search_countries` -Retrieve all supported time zones (IANA names) from the Sportmonks Core API +Search for countries by name from the Sportmonks Core API #### Input | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The country name to search for \(e.g. Brazil\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. continent;regions\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `timezones` | array | Array of supported IANA time zone names \(e.g. Europe/London\) | +| `countries` | array | Array of country objects matching the search query | +| ↳ `id` | number | Unique id of the country | +| ↳ `continent_id` | number | Continent of the country | +| ↳ `name` | string | Name of the country | +| ↳ `official_name` | string | Official name of the country | +| ↳ `fifa_name` | string | Official FIFA short code name | +| ↳ `iso2` | string | Two letter country code | +| ↳ `iso3` | string | Three letter country code | +| ↳ `latitude` | string | Latitude position of the country | +| ↳ `longitude` | string | Longitude position of the country | +| ↳ `geonameid` | number | Official geonameid | +| ↳ `borders` | array | Neighbouring countries \(ISO3 codes\) | +| ↳ `image_path` | string | Image path to the country flag | + +### `sportmonks_core_search_regions` + +Search for regions by name from the Sportmonks Core API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Sportmonks API token | +| `query` | string | Yes | The region name to search for \(e.g. Utrecht\) | +| `include` | string | No | Semicolon-separated relations to enrich the response \(e.g. country;cities\) | +| `filters` | string | No | Filters to apply | +| `per_page` | string | No | Number of results per page \(max 50, default 25\) | +| `page` | string | No | Page number to retrieve | +| `order` | string | No | Order direction \(asc or desc\) | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `regions` | array | Array of region objects matching the search query | +| ↳ `id` | number | Unique id of the region | +| ↳ `country_id` | number | Country of the region | +| ↳ `name` | string | Name of the region | diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx index a88a39160b6..4ac5bd3533f 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx @@ -32,7 +32,10 @@ interface AgentGroupProps { items: AgentGroupItem[] isDelegating?: boolean isStreaming?: boolean - defaultExpanded?: boolean + /** This group is the latest section in its parent sequence (drives collapse). */ + isCurrentSection?: boolean + /** The subagent lane is still open (no subagent_end yet) — i.e. actively running. */ + isLaneOpen?: boolean } export function isAgentGroupResolved(items: AgentGroupItem[]): boolean { @@ -55,7 +58,8 @@ export function AgentGroup({ items, isDelegating = false, isStreaming = false, - defaultExpanded = false, + isCurrentSection = false, + isLaneOpen = false, }: AgentGroupProps) { const AgentIcon = getAgentIcon(agentName) const hasItems = items.length > 0 @@ -66,11 +70,17 @@ export function AgentGroup({ // transport gating is needed to stop an aborted-before-first-tool spinner. const showDelegatingSpinner = isDelegating && !resolved - // Expand only while the turn is live and the group is still open or working. - // Once the turn ends (isStreaming false) — or a subagent closes mid-turn — the - // group auto-collapses, so finished subagent blocks never stay expanded. A - // manual toggle pins the choice for the rest of the message. - const autoExpanded = isStreaming && (defaultExpanded || !resolved) + // Expand while the turn is live and any of: the lane is open (the subagent is + // actively running), this is the current/latest section, or there is unresolved + // work. A finished group stays open until the NEXT section starts (it is no + // longer the latest), instead of collapsing the instant its own work resolves. + // Keying "still running" off the lane-open signal (not `resolved` alone) avoids + // a collapse/reopen flicker on parallel siblings: a subagent's tools all + // momentarily read "done" in the gap between its last search and its `respond` + // ("Gathering thoughts") tool, transiently flipping `resolved` true; the open + // lane bridges that gap so the row never collapses mid-run. The turn ending + // (isStreaming false) collapses everything; a manual toggle pins the choice. + const autoExpanded = isStreaming && (isCurrentSection || isLaneOpen || !resolved) const [manualExpanded, setManualExpanded] = useState(null) const expanded = manualExpanded ?? autoExpanded @@ -135,7 +145,8 @@ export function AgentGroup({ items={item.group.items} isDelegating={item.group.isDelegating} isStreaming={isStreaming} - defaultExpanded={item.group.isOpen} + isCurrentSection={idx === items.length - 1} + isLaneOpen={item.group.isOpen} /> ) diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/index.ts b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/index.ts index 4a9a1a2ddf0..f211a5f42e5 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/index.ts +++ b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/index.ts @@ -3,4 +3,3 @@ export { AgentGroup, CircleStop, isAgentGroupResolved } from './agent-group' export { ChatContent } from './chat-content' export { Options } from './options' export { PendingTagIndicator, parseSpecialTags, SpecialTags } from './special-tags' -export { ThinkingBlock } from './thinking-block' diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/index.ts b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/index.ts deleted file mode 100644 index 4b82db6a47d..00000000000 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ThinkingBlock } from './thinking-block' diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/thinking-block.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/thinking-block.tsx deleted file mode 100644 index 208a358b975..00000000000 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/thinking-block/thinking-block.tsx +++ /dev/null @@ -1,108 +0,0 @@ -'use client' - -import { useEffect, useLayoutEffect, useRef, useState } from 'react' -import { Blimp, ChevronDown, Expandable, ExpandableContent } from '@/components/emcn' -import { cn } from '@/lib/core/utils/cn' - -interface ThinkingBlockProps { - content: string - isActive: boolean - isStreaming?: boolean - startedAt?: number -} - -const MIN_VISIBLE_THINKING_MS = 3000 - -export function ThinkingBlock({ - content, - isActive, - isStreaming = false, - startedAt, -}: ThinkingBlockProps) { - // Start collapsed so the `Expandable` plays its height-open animation - // when `expanded` flips to true below — otherwise the panel mounts - // already-open and jumps up with its full content in one frame. - const [expanded, setExpanded] = useState(false) - const panelRef = useRef(null) - const wasActiveRef = useRef(null) - // Suppress active thinking until it exceeds MIN_VISIBLE_THINKING_MS. - // Completed-<=threshold is filtered upstream in message-content, so if - // we're mounted with isActive=false we've already passed that gate. - const [thresholdReached, setThresholdReached] = useState(() => { - if (!isActive || startedAt === undefined) return true - return Date.now() - startedAt > MIN_VISIBLE_THINKING_MS - }) - - useEffect(() => { - if (thresholdReached) return - if (!isActive || startedAt === undefined) { - setThresholdReached(true) - return - } - const remainingMs = Math.max(0, MIN_VISIBLE_THINKING_MS - (Date.now() - startedAt)) - const id = window.setTimeout(() => setThresholdReached(true), remainingMs + 50) - return () => window.clearTimeout(id) - }, [isActive, startedAt, thresholdReached]) - - useEffect(() => { - // Wait until the threshold has actually been reached — otherwise this - // effect fires during the 3-second hidden period (while the component - // returns null) and sets `expanded` to true before the panel is even - // rendered, so the Collapsible mounts already-open with no animation. - if (!thresholdReached) return - if (wasActiveRef.current === isActive) return - // On first run (wasActiveRef === null): open if the stream is live — - // even when thinking itself has already ended — so a mid-stream refresh - // shows the thinking panel open while the rest of the response is still - // being generated. Subsequent runs only react to the isActive transition - // (auto-collapse when thinking ends). - const isFirstRun = wasActiveRef.current === null - wasActiveRef.current = isActive - const target = isFirstRun ? isActive || isStreaming : isActive - // Defer to the next frame so Radix Collapsible paints the closed state - // first, then sees the transition to open. Without this, React can batch - // the mount + flip into a single commit and the animation never plays. - const id = window.requestAnimationFrame(() => setExpanded(target)) - return () => window.cancelAnimationFrame(id) - }, [isActive, isStreaming, thresholdReached]) - - useLayoutEffect(() => { - if (!isActive || !expanded) return - const el = panelRef.current - if (!el) return - el.scrollTop = el.scrollHeight - }, [content, isActive, expanded]) - - if (!thresholdReached) return null - - return ( -
- - - - -
-
- {content} -
-
-
-
-
- ) -} diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx index a8a0ae35b9d..e4286bf5e22 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx @@ -10,14 +10,7 @@ import { useChatSurface } from '@/app/workspace/[workspaceId]/home/components/ch import type { ContentBlock, OptionItem, ToolCallData } from '../../types' import { SUBAGENT_LABELS } from '../../types' import type { AgentGroupItem } from './components' -import { - AgentGroup, - ChatContent, - CircleStop, - Options, - PendingTagIndicator, - ThinkingBlock, -} from './components' +import { AgentGroup, ChatContent, CircleStop, Options, PendingTagIndicator } from './components' import { deriveMessagePhase, isToolDone, type MessagePhase } from './utils' const FILE_SUBAGENT_ID = 'file' @@ -29,14 +22,6 @@ interface TextSegment { content: string } -interface ThinkingSegment { - type: 'thinking' - id: string - content: string - startedAt?: number - endedAt?: number -} - interface AgentGroupSegment { type: 'agent_group' id: string @@ -56,12 +41,7 @@ interface StoppedSegment { type: 'stopped' } -type MessageSegment = - | TextSegment - | ThinkingSegment - | AgentGroupSegment - | OptionsSegment - | StoppedSegment +type MessageSegment = TextSegment | AgentGroupSegment | OptionsSegment | StoppedSegment const SUBAGENT_KEYS = new Set(Object.keys(SUBAGENT_LABELS)) @@ -279,23 +259,9 @@ function parseBlocksWithSpanTree(blocks: ContentBlock[]): MessageSegment[] { continue } - if (block.type === 'thinking') { - if (!block.content?.trim()) continue - const last = segments[segments.length - 1] - if (last?.type === 'thinking' && last.endedAt === undefined) { - last.content += block.content - if (block.endedAt !== undefined) last.endedAt = block.endedAt - } else { - segments.push({ - type: 'thinking', - id: `thinking-${i}`, - content: block.content, - startedAt: block.timestamp, - endedAt: block.endedAt, - }) - } - continue - } + // Main-agent thinking is intentionally not rendered. The reasoning is still + // reduced and persisted upstream — this is a display-only omission. + if (block.type === 'thinking') continue if (block.type === 'text') { if (!block.content) continue @@ -515,21 +481,10 @@ function parseBlocksLegacy(blocks: ContentBlock[]): MessageSegment[] { } if (block.type === 'thinking') { + // Main-agent thinking is not rendered, but it still breaks open subagent + // lanes so later chunks don't merge across it (display-only omission). if (!block.content?.trim()) continue flushLanes() - const last = segments[segments.length - 1] - if (last?.type === 'thinking' && last.endedAt === undefined) { - last.content += block.content - if (block.endedAt !== undefined) last.endedAt = block.endedAt - } else { - segments.push({ - type: 'thinking', - id: `thinking-${i}`, - content: block.content, - startedAt: block.timestamp, - endedAt: block.endedAt, - }) - } continue } @@ -776,29 +731,6 @@ function MessageContentInner({ } /> ) - case 'thinking': { - const isActive = - isStreaming && i === segments.length - 1 && segment.endedAt === undefined - const elapsedMs = - segment.startedAt !== undefined && segment.endedAt !== undefined - ? segment.endedAt - segment.startedAt - : undefined - // Hide completed thinking that took 3s or less — quick thinking - // isn't worth the visual noise. Still show while active (unknown - // duration yet) and still show when timing is missing (old - // persisted blocks) so we don't drop historical content. - if (elapsedMs !== undefined && elapsedMs <= 3000) return null - return ( -
- -
- ) - } case 'agent_group': { return (
@@ -809,7 +741,8 @@ function MessageContentInner({ items={segment.items} isDelegating={segment.isDelegating} isStreaming={isStreaming} - defaultExpanded={segment.isOpen} + isCurrentSection={i === segments.length - 1} + isLaneOpen={segment.isOpen} />
) diff --git a/apps/sim/blocks/blocks/sportmonks.ts b/apps/sim/blocks/blocks/sportmonks.ts index 4939bd51778..4fc5f097db8 100644 --- a/apps/sim/blocks/blocks/sportmonks.ts +++ b/apps/sim/blocks/blocks/sportmonks.ts @@ -13,104 +13,801 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n generationType: 'timestamp' as const, } -const FOOTBALL_OPS = [ - 'football_get_livescores', - 'football_get_inplay_livescores', +const INCLUDE_OPS = [ + 'football_get_team', + 'football_get_totw', + 'core_get_cities', + 'core_get_city', + 'core_get_continent', + 'core_get_continents', + 'core_get_countries', + 'core_get_country', + 'core_get_region', + 'core_get_regions', + 'core_search_cities', + 'core_search_countries', + 'core_search_regions', + 'football_expected_by_player', + 'football_expected_by_team', + 'football_get_all_commentaries', + 'football_get_all_fixtures', + 'football_get_all_players', + 'football_get_all_rivals', + 'football_get_all_teams', + 'football_get_all_transfer_rumours', + 'football_get_all_transfers', + 'football_get_brackets_by_season', + 'football_get_coach', + 'football_get_coaches', + 'football_get_coaches_by_country', + 'football_get_commentaries_by_fixture', + 'football_get_current_leagues_by_team', + 'football_get_expected_lineups_by_player', + 'football_get_expected_lineups_by_team', + 'football_get_extended_team_squad', + 'football_get_fixture', 'football_get_fixtures_by_date', 'football_get_fixtures_by_date_range', - 'football_get_fixture', + 'football_get_fixtures_by_date_range_for_team', + 'football_get_fixtures_by_ids', + 'football_get_grouped_standings_by_round', 'football_get_head_to_head', - 'football_get_leagues', + 'football_get_inplay_livescores', + 'football_get_latest_coaches', + 'football_get_latest_fixtures', + 'football_get_latest_livescores', + 'football_get_latest_players', + 'football_get_latest_totw', + 'football_get_latest_transfers', 'football_get_league', - 'football_search_teams', - 'football_get_team', - 'football_get_team_squad', - 'football_search_players', + 'football_get_leagues', + 'football_get_leagues_by_country', + 'football_get_leagues_by_date', + 'football_get_leagues_by_team', + 'football_get_live_leagues', + 'football_get_live_probabilities', + 'football_get_live_probabilities_by_fixture', + 'football_get_live_standings_by_league', + 'football_get_livescores', + 'football_get_match_facts', + 'football_get_match_facts_by_date_range', + 'football_get_match_facts_by_fixture', + 'football_get_match_facts_by_league', + 'football_get_past_fixtures_by_tv_station', 'football_get_player', + 'football_get_players_by_country', + 'football_get_postmatch_news', + 'football_get_postmatch_news_by_season', + 'football_get_predictability_by_league', + 'football_get_prematch_news', + 'football_get_prematch_news_by_season', + 'football_get_prematch_news_upcoming', + 'football_get_probabilities', + 'football_get_probabilities_by_fixture', + 'football_get_referee', + 'football_get_referees', + 'football_get_referees_by_country', + 'football_get_referees_by_season', + 'football_get_rivals_by_team', + 'football_get_round', + 'football_get_round_statistics', + 'football_get_rounds', + 'football_get_rounds_by_season', + 'football_get_season', + 'football_get_seasons', + 'football_get_seasons_by_team', + 'football_get_stage', + 'football_get_stage_statistics', + 'football_get_stages', + 'football_get_stages_by_season', + 'football_get_standing_corrections_by_season', + 'football_get_standings', + 'football_get_standings_by_round', 'football_get_standings_by_season', + 'football_get_team_rankings', + 'football_get_team_rankings_by_date', + 'football_get_team_rankings_by_team', + 'football_get_team_squad', + 'football_get_team_squad_by_season', + 'football_get_teams_by_country', + 'football_get_teams_by_season', 'football_get_topscorers_by_season', -] - -const MOTORSPORT_OPS = [ - 'motorsport_get_livescores', - 'motorsport_get_fixtures_by_date', - 'motorsport_get_fixture', - 'motorsport_get_drivers', + 'football_get_topscorers_by_stage', + 'football_get_totw_by_round', + 'football_get_transfer', + 'football_get_transfer_rumour', + 'football_get_transfer_rumours_between_dates', + 'football_get_transfer_rumours_by_player', + 'football_get_transfer_rumours_by_team', + 'football_get_transfers_between_dates', + 'football_get_transfers_by_player', + 'football_get_transfers_by_team', + 'football_get_tv_station', + 'football_get_tv_stations', + 'football_get_tv_stations_by_fixture', + 'football_get_upcoming_fixtures_by_market', + 'football_get_upcoming_fixtures_by_tv_station', + 'football_get_value_bets', + 'football_get_value_bets_by_fixture', + 'football_get_venue', + 'football_get_venues', + 'football_get_venues_by_season', + 'football_search_coaches', + 'football_search_fixtures', + 'football_search_leagues', + 'football_search_players', + 'football_search_referees', + 'football_search_rounds', + 'football_search_seasons', + 'football_search_stages', + 'football_search_teams', + 'football_search_venues', + 'motorsport_get_all_fixtures', + 'motorsport_get_current_leagues_by_team', 'motorsport_get_driver', - 'motorsport_search_drivers', - 'motorsport_get_teams', - 'motorsport_get_team', + 'motorsport_get_driver_standings', 'motorsport_get_driver_standings_by_season', - 'motorsport_get_team_standings_by_season', + 'motorsport_get_drivers', + 'motorsport_get_drivers_by_country', + 'motorsport_get_drivers_by_season', + 'motorsport_get_fixture', + 'motorsport_get_fixtures_by_date', + 'motorsport_get_fixtures_by_date_range', + 'motorsport_get_fixtures_by_ids', 'motorsport_get_laps_by_fixture', + 'motorsport_get_laps_by_fixture_and_driver', + 'motorsport_get_laps_by_fixture_and_lap', + 'motorsport_get_latest_laps_by_fixture', + 'motorsport_get_latest_pitstops_by_fixture', + 'motorsport_get_latest_stints_by_fixture', + 'motorsport_get_latest_updated_drivers', + 'motorsport_get_latest_updated_fixtures', + 'motorsport_get_league', + 'motorsport_get_leagues', + 'motorsport_get_leagues_by_country', + 'motorsport_get_leagues_by_date', + 'motorsport_get_leagues_by_live', + 'motorsport_get_leagues_by_team', + 'motorsport_get_livescores', 'motorsport_get_pitstops_by_fixture', + 'motorsport_get_pitstops_by_fixture_and_driver', + 'motorsport_get_pitstops_by_fixture_and_lap', + 'motorsport_get_race_results_by_season_and_driver', + 'motorsport_get_race_results_by_season_and_team', + 'motorsport_get_schedules_by_season', + 'motorsport_get_season', + 'motorsport_get_seasons', + 'motorsport_get_stage', + 'motorsport_get_stages', + 'motorsport_get_stages_by_season', + 'motorsport_get_state', + 'motorsport_get_states', + 'motorsport_get_stints_by_fixture', + 'motorsport_get_stints_by_fixture_and_driver', + 'motorsport_get_stints_by_fixture_and_stint', + 'motorsport_get_team', + 'motorsport_get_team_standings', + 'motorsport_get_team_standings_by_season', + 'motorsport_get_teams', + 'motorsport_get_teams_by_country', + 'motorsport_get_teams_by_season', + 'motorsport_get_venue', + 'motorsport_get_venues', + 'motorsport_get_venues_by_season', + 'motorsport_search_drivers', + 'motorsport_search_leagues', + 'motorsport_search_stages', + 'motorsport_search_teams', + 'motorsport_search_venues', + 'odds_get_all_historical_odds', + 'odds_get_all_inplay_odds', + 'odds_get_all_pre_match_odds', + 'odds_get_all_premium_odds', + 'odds_get_inplay_odds_by_fixture', + 'odds_get_inplay_odds_by_fixture_and_bookmaker', + 'odds_get_inplay_odds_by_fixture_and_market', + 'odds_get_last_updated_inplay_odds', + 'odds_get_last_updated_pre_match_odds', + 'odds_get_pre_match_odds_by_fixture', + 'odds_get_pre_match_odds_by_fixture_and_bookmaker', + 'odds_get_pre_match_odds_by_fixture_and_market', + 'odds_get_premium_odds_by_fixture', + 'odds_get_premium_odds_by_fixture_and_bookmaker', + 'odds_get_premium_odds_by_fixture_and_market', + 'odds_get_updated_historical_odds_between', + 'odds_get_updated_premium_odds_between', ] -const CORE_GEO_OPS = [ - 'core_get_continents', - 'core_get_continent', +const FILTER_OPS = [ + 'football_get_team', + 'core_get_cities', 'core_get_countries', - 'core_get_country', - 'core_search_countries', 'core_get_regions', - 'core_get_region', - 'core_get_cities', - 'core_get_city', 'core_search_cities', -] - -const ODDS_FIXTURE_OPS = ['odds_get_pre_match_odds_by_fixture', 'odds_get_inplay_odds_by_fixture'] - -const INCLUDE_OPS = [...FOOTBALL_OPS, ...MOTORSPORT_OPS, ...ODDS_FIXTURE_OPS, ...CORE_GEO_OPS] - -const FILTER_OPS = [ - ...FOOTBALL_OPS, - ...MOTORSPORT_OPS, - ...ODDS_FIXTURE_OPS, + 'core_search_countries', + 'core_search_regions', + 'football_expected_by_player', + 'football_expected_by_team', + 'football_get_all_commentaries', + 'football_get_all_fixtures', + 'football_get_all_players', + 'football_get_all_rivals', + 'football_get_all_teams', + 'football_get_all_transfer_rumours', + 'football_get_all_transfers', + 'football_get_coach', + 'football_get_coaches', + 'football_get_coaches_by_country', + 'football_get_current_leagues_by_team', + 'football_get_expected_lineups_by_player', + 'football_get_expected_lineups_by_team', + 'football_get_extended_team_squad', + 'football_get_fixture', + 'football_get_fixtures_by_date', + 'football_get_fixtures_by_date_range', + 'football_get_fixtures_by_date_range_for_team', + 'football_get_fixtures_by_ids', + 'football_get_grouped_standings_by_round', + 'football_get_head_to_head', + 'football_get_inplay_livescores', + 'football_get_latest_coaches', + 'football_get_latest_fixtures', + 'football_get_latest_livescores', + 'football_get_latest_players', + 'football_get_latest_transfers', + 'football_get_league', + 'football_get_leagues', + 'football_get_leagues_by_country', + 'football_get_leagues_by_date', + 'football_get_leagues_by_team', + 'football_get_live_leagues', + 'football_get_live_standings_by_league', + 'football_get_livescores', + 'football_get_match_facts', + 'football_get_match_facts_by_date_range', + 'football_get_match_facts_by_fixture', + 'football_get_match_facts_by_league', + 'football_get_past_fixtures_by_tv_station', + 'football_get_player', + 'football_get_players_by_country', + 'football_get_postmatch_news', + 'football_get_postmatch_news_by_season', + 'football_get_predictability_by_league', + 'football_get_prematch_news', + 'football_get_prematch_news_by_season', + 'football_get_prematch_news_upcoming', + 'football_get_probabilities', + 'football_get_probabilities_by_fixture', + 'football_get_referee', + 'football_get_referees', + 'football_get_referees_by_country', + 'football_get_referees_by_season', + 'football_get_round', + 'football_get_round_statistics', + 'football_get_rounds', + 'football_get_rounds_by_season', + 'football_get_season', + 'football_get_seasons', + 'football_get_seasons_by_team', + 'football_get_stage', + 'football_get_stage_statistics', + 'football_get_stages', + 'football_get_stages_by_season', + 'football_get_standing_corrections_by_season', + 'football_get_standings', + 'football_get_standings_by_round', + 'football_get_standings_by_season', + 'football_get_team_squad', + 'football_get_team_squad_by_season', + 'football_get_teams_by_country', + 'football_get_teams_by_season', + 'football_get_topscorers_by_season', + 'football_get_topscorers_by_stage', + 'football_get_transfer', + 'football_get_transfer_rumour', + 'football_get_transfer_rumours_between_dates', + 'football_get_transfer_rumours_by_player', + 'football_get_transfer_rumours_by_team', + 'football_get_transfers_between_dates', + 'football_get_transfers_by_player', + 'football_get_transfers_by_team', + 'football_get_tv_station', + 'football_get_tv_stations', + 'football_get_tv_stations_by_fixture', + 'football_get_upcoming_fixtures_by_market', + 'football_get_upcoming_fixtures_by_tv_station', + 'football_get_venue', + 'football_get_venues', + 'football_get_venues_by_season', + 'football_search_coaches', + 'football_search_fixtures', + 'football_search_leagues', + 'football_search_players', + 'football_search_referees', + 'football_search_rounds', + 'football_search_seasons', + 'football_search_stages', + 'football_search_teams', + 'football_search_venues', + 'motorsport_get_all_fixtures', + 'motorsport_get_current_leagues_by_team', + 'motorsport_get_driver', + 'motorsport_get_driver_standings', + 'motorsport_get_driver_standings_by_season', + 'motorsport_get_drivers', + 'motorsport_get_drivers_by_country', + 'motorsport_get_drivers_by_season', + 'motorsport_get_fixture', + 'motorsport_get_fixtures_by_date', + 'motorsport_get_fixtures_by_date_range', + 'motorsport_get_fixtures_by_ids', + 'motorsport_get_laps_by_fixture', + 'motorsport_get_laps_by_fixture_and_driver', + 'motorsport_get_laps_by_fixture_and_lap', + 'motorsport_get_latest_laps_by_fixture', + 'motorsport_get_latest_pitstops_by_fixture', + 'motorsport_get_latest_stints_by_fixture', + 'motorsport_get_latest_updated_drivers', + 'motorsport_get_latest_updated_fixtures', + 'motorsport_get_league', + 'motorsport_get_leagues', + 'motorsport_get_leagues_by_country', + 'motorsport_get_leagues_by_date', + 'motorsport_get_leagues_by_live', + 'motorsport_get_leagues_by_team', + 'motorsport_get_livescores', + 'motorsport_get_pitstops_by_fixture', + 'motorsport_get_pitstops_by_fixture_and_driver', + 'motorsport_get_pitstops_by_fixture_and_lap', + 'motorsport_get_race_results_by_season_and_driver', + 'motorsport_get_race_results_by_season_and_team', + 'motorsport_get_schedules_by_season', + 'motorsport_get_season', + 'motorsport_get_seasons', + 'motorsport_get_stage', + 'motorsport_get_stages', + 'motorsport_get_stages_by_season', + 'motorsport_get_state', + 'motorsport_get_states', + 'motorsport_get_stints_by_fixture', + 'motorsport_get_stints_by_fixture_and_driver', + 'motorsport_get_stints_by_fixture_and_stint', + 'motorsport_get_team', + 'motorsport_get_team_standings', + 'motorsport_get_team_standings_by_season', + 'motorsport_get_teams', + 'motorsport_get_teams_by_country', + 'motorsport_get_teams_by_season', + 'motorsport_get_venue', + 'motorsport_get_venues', + 'motorsport_get_venues_by_season', + 'motorsport_search_drivers', + 'motorsport_search_leagues', + 'motorsport_search_stages', + 'motorsport_search_teams', + 'motorsport_search_venues', + 'odds_get_all_historical_odds', + 'odds_get_all_inplay_odds', + 'odds_get_all_pre_match_odds', + 'odds_get_all_premium_odds', 'odds_get_bookmakers', + 'odds_get_inplay_odds_by_fixture', + 'odds_get_inplay_odds_by_fixture_and_bookmaker', + 'odds_get_inplay_odds_by_fixture_and_market', + 'odds_get_last_updated_inplay_odds', + 'odds_get_last_updated_pre_match_odds', 'odds_get_markets', - 'core_get_continents', - 'core_get_countries', - 'core_get_regions', - 'core_get_cities', + 'odds_get_pre_match_odds_by_fixture', + 'odds_get_pre_match_odds_by_fixture_and_bookmaker', + 'odds_get_pre_match_odds_by_fixture_and_market', + 'odds_get_premium_odds_by_fixture', + 'odds_get_premium_odds_by_fixture_and_bookmaker', + 'odds_get_premium_odds_by_fixture_and_market', + 'odds_get_updated_historical_odds_between', + 'odds_get_updated_premium_odds_between', ] const PAGINATED_OPS = [ + 'football_get_totw', + 'core_get_cities', + 'core_get_continents', + 'core_get_countries', + 'core_get_my_usage', + 'core_get_regions', + 'core_get_types', + 'core_search_cities', + 'core_search_countries', + 'core_search_regions', + 'football_expected_by_player', + 'football_expected_by_team', + 'football_get_all_commentaries', + 'football_get_all_fixtures', + 'football_get_all_players', + 'football_get_all_rivals', + 'football_get_all_teams', + 'football_get_all_transfer_rumours', + 'football_get_all_transfers', + 'football_get_coaches', + 'football_get_coaches_by_country', + 'football_get_current_leagues_by_team', + 'football_get_expected_lineups_by_player', + 'football_get_expected_lineups_by_team', 'football_get_fixtures_by_date', 'football_get_fixtures_by_date_range', + 'football_get_fixtures_by_date_range_for_team', 'football_get_head_to_head', + 'football_get_latest_coaches', + 'football_get_latest_transfers', 'football_get_leagues', - 'football_search_teams', - 'football_search_players', + 'football_get_leagues_by_country', + 'football_get_leagues_by_date', + 'football_get_leagues_by_team', + 'football_get_live_leagues', + 'football_get_live_probabilities', + 'football_get_live_probabilities_by_fixture', + 'football_get_match_facts', + 'football_get_match_facts_by_date_range', + 'football_get_match_facts_by_fixture', + 'football_get_match_facts_by_league', + 'football_get_past_fixtures_by_tv_station', + 'football_get_players_by_country', + 'football_get_postmatch_news', + 'football_get_postmatch_news_by_season', + 'football_get_predictability_by_league', + 'football_get_prematch_news', + 'football_get_prematch_news_by_season', + 'football_get_prematch_news_upcoming', + 'football_get_probabilities', + 'football_get_probabilities_by_fixture', + 'football_get_referees', + 'football_get_referees_by_country', + 'football_get_referees_by_season', + 'football_get_round_statistics', + 'football_get_rounds', + 'football_get_seasons', + 'football_get_stage_statistics', + 'football_get_stages', + 'football_get_standings', + 'football_get_states', + 'football_get_team_rankings', + 'football_get_team_rankings_by_date', + 'football_get_team_rankings_by_team', + 'football_get_teams_by_country', + 'football_get_teams_by_season', 'football_get_topscorers_by_season', - 'motorsport_get_livescores', - 'motorsport_get_fixtures_by_date', - 'motorsport_get_drivers', - 'motorsport_search_drivers', - 'motorsport_get_teams', + 'football_get_topscorers_by_stage', + 'football_get_transfer_rumours_between_dates', + 'football_get_transfer_rumours_by_player', + 'football_get_transfer_rumours_by_team', + 'football_get_transfers_between_dates', + 'football_get_transfers_by_player', + 'football_get_transfers_by_team', + 'football_get_tv_stations', + 'football_get_tv_stations_by_fixture', + 'football_get_upcoming_fixtures_by_market', + 'football_get_upcoming_fixtures_by_tv_station', + 'football_get_value_bets', + 'football_get_value_bets_by_fixture', + 'football_get_venues', + 'football_search_coaches', + 'football_search_fixtures', + 'football_search_leagues', + 'football_search_players', + 'football_search_referees', + 'football_search_rounds', + 'football_search_seasons', + 'football_search_stages', + 'football_search_teams', + 'football_search_venues', + 'motorsport_get_all_fixtures', + 'motorsport_get_current_leagues_by_team', + 'motorsport_get_driver_standings', 'motorsport_get_driver_standings_by_season', + 'motorsport_get_drivers', + 'motorsport_get_drivers_by_country', + 'motorsport_get_drivers_by_season', + 'motorsport_get_fixtures_by_date', + 'motorsport_get_fixtures_by_date_range', + 'motorsport_get_fixtures_by_ids', + 'motorsport_get_latest_updated_drivers', + 'motorsport_get_latest_updated_fixtures', + 'motorsport_get_leagues', + 'motorsport_get_leagues_by_country', + 'motorsport_get_leagues_by_date', + 'motorsport_get_leagues_by_live', + 'motorsport_get_leagues_by_team', + 'motorsport_get_livescores', + 'motorsport_get_race_results_by_season_and_driver', + 'motorsport_get_race_results_by_season_and_team', + 'motorsport_get_schedules_by_season', + 'motorsport_get_seasons', + 'motorsport_get_stages', + 'motorsport_get_stages_by_season', + 'motorsport_get_states', + 'motorsport_get_team_standings', 'motorsport_get_team_standings_by_season', - 'odds_get_pre_match_odds_by_fixture', - 'odds_get_inplay_odds_by_fixture', + 'motorsport_get_teams', + 'motorsport_get_teams_by_country', + 'motorsport_get_teams_by_season', + 'motorsport_get_venues', + 'motorsport_get_venues_by_season', + 'motorsport_search_drivers', + 'motorsport_search_leagues', + 'motorsport_search_stages', + 'motorsport_search_teams', + 'motorsport_search_venues', + 'odds_get_all_historical_odds', + 'odds_get_all_inplay_odds', + 'odds_get_all_pre_match_odds', + 'odds_get_all_premium_odds', + 'odds_get_bookmaker_event_ids_by_fixture', 'odds_get_bookmakers', - 'odds_search_bookmakers', + 'odds_get_bookmakers_by_fixture', + 'odds_get_inplay_odds_by_fixture', 'odds_get_markets', + 'odds_get_pre_match_odds_by_fixture', + 'odds_get_updated_historical_odds_between', + 'odds_get_updated_premium_odds_between', + 'odds_search_bookmakers', 'odds_search_markets', - 'core_get_continents', - 'core_get_countries', - 'core_search_countries', - 'core_get_regions', - 'core_get_cities', +] + +const BOOKMAKER_ID_OPS = [ + 'odds_get_bookmaker', + 'odds_get_inplay_odds_by_fixture_and_bookmaker', + 'odds_get_pre_match_odds_by_fixture_and_bookmaker', + 'odds_get_premium_odds_by_fixture_and_bookmaker', +] + +const CITY_ID_OPS = ['core_get_city'] + +const COACH_ID_OPS = ['football_get_coach'] + +const CONTINENT_ID_OPS = ['core_get_continent'] + +const COUNTRY_ID_OPS = [ + 'core_get_country', + 'football_get_coaches_by_country', + 'football_get_leagues_by_country', + 'football_get_players_by_country', + 'football_get_referees_by_country', + 'football_get_teams_by_country', + 'motorsport_get_drivers_by_country', + 'motorsport_get_leagues_by_country', + 'motorsport_get_teams_by_country', +] + +const DATE_OPS = [ + 'football_get_fixtures_by_date', + 'football_get_leagues_by_date', + 'football_get_team_rankings_by_date', + 'motorsport_get_fixtures_by_date', + 'motorsport_get_leagues_by_date', +] + +const DRIVER_ID_OPS = [ + 'motorsport_get_driver', + 'motorsport_get_laps_by_fixture_and_driver', + 'motorsport_get_pitstops_by_fixture_and_driver', + 'motorsport_get_race_results_by_season_and_driver', + 'motorsport_get_stints_by_fixture_and_driver', +] + +const END_DATE_OPS = [ + 'football_get_fixtures_by_date_range', + 'football_get_fixtures_by_date_range_for_team', + 'football_get_match_facts_by_date_range', + 'football_get_transfer_rumours_between_dates', + 'football_get_transfers_between_dates', + 'motorsport_get_fixtures_by_date_range', +] + +const FIXTURE_ID_OPS = [ + 'football_get_commentaries_by_fixture', + 'football_get_fixture', + 'football_get_live_probabilities_by_fixture', + 'football_get_match_facts_by_fixture', + 'football_get_probabilities_by_fixture', + 'football_get_tv_stations_by_fixture', + 'football_get_value_bets_by_fixture', + 'motorsport_get_fixture', + 'motorsport_get_laps_by_fixture', + 'motorsport_get_laps_by_fixture_and_driver', + 'motorsport_get_laps_by_fixture_and_lap', + 'motorsport_get_latest_laps_by_fixture', + 'motorsport_get_latest_pitstops_by_fixture', + 'motorsport_get_latest_stints_by_fixture', + 'motorsport_get_pitstops_by_fixture', + 'motorsport_get_pitstops_by_fixture_and_driver', + 'motorsport_get_pitstops_by_fixture_and_lap', + 'motorsport_get_stints_by_fixture', + 'motorsport_get_stints_by_fixture_and_driver', + 'motorsport_get_stints_by_fixture_and_stint', + 'odds_get_bookmaker_event_ids_by_fixture', + 'odds_get_bookmakers_by_fixture', + 'odds_get_inplay_odds_by_fixture', + 'odds_get_inplay_odds_by_fixture_and_bookmaker', + 'odds_get_inplay_odds_by_fixture_and_market', + 'odds_get_pre_match_odds_by_fixture', + 'odds_get_pre_match_odds_by_fixture_and_bookmaker', + 'odds_get_pre_match_odds_by_fixture_and_market', + 'odds_get_premium_odds_by_fixture', + 'odds_get_premium_odds_by_fixture_and_bookmaker', + 'odds_get_premium_odds_by_fixture_and_market', +] + +const FIXTURE_IDS_OPS = ['motorsport_get_fixtures_by_ids'] + +const FROM_TIMESTAMP_OPS = [ + 'odds_get_updated_historical_odds_between', + 'odds_get_updated_premium_odds_between', +] + +const IDS_OPS = ['football_get_fixtures_by_ids'] + +const LAP_NUMBER_OPS = [ + 'motorsport_get_laps_by_fixture_and_lap', + 'motorsport_get_pitstops_by_fixture_and_lap', +] + +const LEAGUE_ID_OPS = [ + 'football_get_latest_totw', + 'football_get_league', + 'football_get_live_standings_by_league', + 'football_get_match_facts_by_league', + 'football_get_predictability_by_league', + 'motorsport_get_league', +] + +const MARKET_ID_OPS = [ + 'football_get_upcoming_fixtures_by_market', + 'odds_get_inplay_odds_by_fixture_and_market', + 'odds_get_market', + 'odds_get_pre_match_odds_by_fixture_and_market', + 'odds_get_premium_odds_by_fixture_and_market', +] + +const PLAYER_ID_OPS = [ + 'football_get_expected_lineups_by_player', + 'football_get_player', + 'football_get_transfer_rumours_by_player', + 'football_get_transfers_by_player', +] + +const QUERY_OPS = [ 'core_search_cities', - 'core_get_types', + 'core_search_countries', + 'core_search_regions', + 'football_search_coaches', + 'football_search_fixtures', + 'football_search_leagues', + 'football_search_players', + 'football_search_referees', + 'football_search_rounds', + 'football_search_seasons', + 'football_search_stages', + 'football_search_teams', + 'football_search_venues', + 'motorsport_search_drivers', + 'motorsport_search_leagues', + 'motorsport_search_stages', + 'motorsport_search_teams', + 'motorsport_search_venues', + 'odds_search_bookmakers', + 'odds_search_markets', +] + +const REFEREE_ID_OPS = ['football_get_referee'] + +const REGION_ID_OPS = ['core_get_region'] + +const ROUND_ID_OPS = [ + 'football_get_grouped_standings_by_round', + 'football_get_round', + 'football_get_round_statistics', + 'football_get_standings_by_round', + 'football_get_totw_by_round', +] + +const RUMOUR_ID_OPS = ['football_get_transfer_rumour'] + +const SEASON_ID_OPS = [ + 'football_get_brackets_by_season', + 'football_get_postmatch_news_by_season', + 'football_get_prematch_news_by_season', + 'football_get_referees_by_season', + 'football_get_rounds_by_season', + 'football_get_schedules_by_season', + 'football_get_schedules_by_season_and_team', + 'football_get_season', + 'football_get_stages_by_season', + 'football_get_standing_corrections_by_season', + 'football_get_standings_by_season', + 'football_get_team_squad_by_season', + 'football_get_teams_by_season', + 'football_get_topscorers_by_season', + 'football_get_venues_by_season', + 'motorsport_get_driver_standings_by_season', + 'motorsport_get_drivers_by_season', + 'motorsport_get_race_results_by_season_and_driver', + 'motorsport_get_race_results_by_season_and_team', + 'motorsport_get_schedules_by_season', + 'motorsport_get_season', + 'motorsport_get_stages_by_season', + 'motorsport_get_team_standings_by_season', + 'motorsport_get_teams_by_season', + 'motorsport_get_venues_by_season', +] + +const STAGE_ID_OPS = [ + 'football_get_stage', + 'football_get_stage_statistics', + 'football_get_topscorers_by_stage', + 'motorsport_get_stage', +] + +const START_DATE_OPS = [ + 'football_get_fixtures_by_date_range', + 'football_get_fixtures_by_date_range_for_team', + 'football_get_match_facts_by_date_range', + 'football_get_transfer_rumours_between_dates', + 'football_get_transfers_between_dates', + 'motorsport_get_fixtures_by_date_range', +] + +const STATE_ID_OPS = ['football_get_state', 'motorsport_get_state'] + +const STINT_NUMBER_OPS = ['motorsport_get_stints_by_fixture_and_stint'] + +const TEAM_1_OPS = ['football_get_head_to_head'] + +const TEAM_2_OPS = ['football_get_head_to_head'] + +const TEAM_ID_OPS = [ + 'football_get_team', + 'football_get_current_leagues_by_team', + 'football_get_expected_lineups_by_team', + 'football_get_extended_team_squad', + 'football_get_fixtures_by_date_range_for_team', + 'football_get_leagues_by_team', + 'football_get_rivals_by_team', + 'football_get_schedules_by_season_and_team', + 'football_get_schedules_by_team', + 'football_get_seasons_by_team', + 'football_get_team_rankings_by_team', + 'football_get_team_squad', + 'football_get_team_squad_by_season', + 'football_get_transfer_rumours_by_team', + 'football_get_transfers_by_team', + 'motorsport_get_current_leagues_by_team', + 'motorsport_get_leagues_by_team', + 'motorsport_get_race_results_by_season_and_team', + 'motorsport_get_team', ] +const TO_TIMESTAMP_OPS = [ + 'odds_get_updated_historical_odds_between', + 'odds_get_updated_premium_odds_between', +] + +const TRANSFER_ID_OPS = ['football_get_transfer'] + +const TV_STATION_ID_OPS = [ + 'football_get_past_fixtures_by_tv_station', + 'football_get_tv_station', + 'football_get_upcoming_fixtures_by_tv_station', +] + +const TYPE_ID_OPS = ['core_get_type'] + +const VENUE_ID_OPS = ['football_get_venue', 'motorsport_get_venue'] + export const SportmonksBlock: BlockConfig = { type: 'sportmonks', name: 'Sportmonks', description: 'Access Sportmonks football, motorsport, odds, and reference data', longDescription: - 'Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, teams, squads, players, standings, and topscorers. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones.', + 'Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, seasons, stages, rounds, teams, squads, players, coaches, referees, venues, standings, topscorers, transfers, schedules, commentaries, TV stations, rivals, expected goals (xG), and predictions. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones.', docsLink: 'https://docs.sim.ai/integrations/sportmonks', category: 'tools', integrationType: IntegrationType.Analytics, @@ -123,358 +820,1057 @@ export const SportmonksBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Football - { label: 'Get Live Football Scores', id: 'football_get_livescores', group: 'Football' }, { - label: 'Get Inplay Football Scores', - id: 'football_get_inplay_livescores', + label: 'Football: Get Expected xG by Player', + id: 'football_expected_by_player', + group: 'Football', + }, + { + label: 'Football: Get Expected xG by Team', + id: 'football_expected_by_team', + group: 'Football', + }, + { + label: 'Football: Get All Commentaries', + id: 'football_get_all_commentaries', + group: 'Football', + }, + { label: 'Football: Get All Fixtures', id: 'football_get_all_fixtures', group: 'Football' }, + { label: 'Football: Get All Players', id: 'football_get_all_players', group: 'Football' }, + { label: 'Football: Get All Rivals', id: 'football_get_all_rivals', group: 'Football' }, + { label: 'Football: Get All Teams', id: 'football_get_all_teams', group: 'Football' }, + { + label: 'Football: Get All Transfer Rumours', + id: 'football_get_all_transfer_rumours', + group: 'Football', + }, + { + label: 'Football: Get All Transfers', + id: 'football_get_all_transfers', + group: 'Football', + }, + { + label: 'Football: Get Brackets by Season', + id: 'football_get_brackets_by_season', + group: 'Football', + }, + { label: 'Football: Get Coach by ID', id: 'football_get_coach', group: 'Football' }, + { label: 'Football: Get Coaches', id: 'football_get_coaches', group: 'Football' }, + { + label: 'Football: Get Coaches by Country', + id: 'football_get_coaches_by_country', + group: 'Football', + }, + { + label: 'Football: Get Commentaries by Fixture', + id: 'football_get_commentaries_by_fixture', + group: 'Football', + }, + { + label: 'Football: Get Current Leagues by Team', + id: 'football_get_current_leagues_by_team', + group: 'Football', + }, + { + label: 'Football: Get Expected Lineups by Player', + id: 'football_get_expected_lineups_by_player', + group: 'Football', + }, + { + label: 'Football: Get Expected Lineups by Team', + id: 'football_get_expected_lineups_by_team', + group: 'Football', + }, + { + label: 'Football: Get Extended Team Squad', + id: 'football_get_extended_team_squad', group: 'Football', }, + { label: 'Football: Get Fixture by ID', id: 'football_get_fixture', group: 'Football' }, { - label: 'Get Football Fixtures by Date', + label: 'Football: Get Fixtures by Date', id: 'football_get_fixtures_by_date', group: 'Football', }, { - label: 'Get Football Fixtures by Date Range', + label: 'Football: Get Fixtures by Date Range', id: 'football_get_fixtures_by_date_range', group: 'Football', }, - { label: 'Get Football Fixture by ID', id: 'football_get_fixture', group: 'Football' }, - { label: 'Get Football Head to Head', id: 'football_get_head_to_head', group: 'Football' }, - { label: 'Get Football Leagues', id: 'football_get_leagues', group: 'Football' }, - { label: 'Get Football League by ID', id: 'football_get_league', group: 'Football' }, - { label: 'Search Football Teams', id: 'football_search_teams', group: 'Football' }, - { label: 'Get Football Team by ID', id: 'football_get_team', group: 'Football' }, - { label: 'Get Football Team Squad', id: 'football_get_team_squad', group: 'Football' }, - { label: 'Search Football Players', id: 'football_search_players', group: 'Football' }, - { label: 'Get Football Player by ID', id: 'football_get_player', group: 'Football' }, { - label: 'Get Football Standings by Season', - id: 'football_get_standings_by_season', - group: 'Football', + label: 'Football: Get Fixtures by Date Range for Team', + id: 'football_get_fixtures_by_date_range_for_team', + group: 'Football', + }, + { + label: 'Football: Get Fixtures by Multiple IDs', + id: 'football_get_fixtures_by_ids', + group: 'Football', + }, + { + label: 'Football: Get Grouped Standings by Round', + id: 'football_get_grouped_standings_by_round', + group: 'Football', + }, + { label: 'Football: Get Head to Head', id: 'football_get_head_to_head', group: 'Football' }, + { + label: 'Football: Get Inplay Livescores', + id: 'football_get_inplay_livescores', + group: 'Football', + }, + { + label: 'Football: Get Last Updated Coaches', + id: 'football_get_latest_coaches', + group: 'Football', + }, + { + label: 'Football: Get Latest Updated Fixtures', + id: 'football_get_latest_fixtures', + group: 'Football', + }, + { + label: 'Football: Get Latest Updated Livescores', + id: 'football_get_latest_livescores', + group: 'Football', + }, + { + label: 'Football: Get Last Updated Players', + id: 'football_get_latest_players', + group: 'Football', + }, + { + label: 'Football: Get Latest Team of the Week', + id: 'football_get_latest_totw', + group: 'Football', + }, + { + label: 'Football: Get Latest Transfers', + id: 'football_get_latest_transfers', + group: 'Football', + }, + { label: 'Football: Get League by ID', id: 'football_get_league', group: 'Football' }, + { label: 'Football: Get Leagues', id: 'football_get_leagues', group: 'Football' }, + { + label: 'Football: Get Leagues by Country', + id: 'football_get_leagues_by_country', + group: 'Football', + }, + { + label: 'Football: Get Leagues by Date', + id: 'football_get_leagues_by_date', + group: 'Football', + }, + { + label: 'Football: Get Leagues by Team', + id: 'football_get_leagues_by_team', + group: 'Football', + }, + { label: 'Football: Get Live Leagues', id: 'football_get_live_leagues', group: 'Football' }, + { + label: 'Football: Get Live Probabilities', + id: 'football_get_live_probabilities', + group: 'Football', + }, + { + label: 'Football: Get Live Probabilities by Fixture', + id: 'football_get_live_probabilities_by_fixture', + group: 'Football', + }, + { + label: 'Football: Get Live Standings by League', + id: 'football_get_live_standings_by_league', + group: 'Football', + }, + { label: 'Football: Get Livescores', id: 'football_get_livescores', group: 'Football' }, + { + label: 'Football: Get All Match Facts', + id: 'football_get_match_facts', + group: 'Football', + }, + { + label: 'Football: Get Match Facts by Date Range', + id: 'football_get_match_facts_by_date_range', + group: 'Football', + }, + { + label: 'Football: Get Match Facts by Fixture', + id: 'football_get_match_facts_by_fixture', + group: 'Football', + }, + { + label: 'Football: Get Match Facts by League', + id: 'football_get_match_facts_by_league', + group: 'Football', + }, + { + label: 'Football: Get Past Fixtures by TV Station', + id: 'football_get_past_fixtures_by_tv_station', + group: 'Football', + }, + { label: 'Football: Get Player by ID', id: 'football_get_player', group: 'Football' }, + { + label: 'Football: Get Players by Country', + id: 'football_get_players_by_country', + group: 'Football', + }, + { + label: 'Football: Get Post-Match News', + id: 'football_get_postmatch_news', + group: 'Football', + }, + { + label: 'Football: Get Post-Match News by Season', + id: 'football_get_postmatch_news_by_season', + group: 'Football', + }, + { + label: 'Football: Get Predictability by League', + id: 'football_get_predictability_by_league', + group: 'Football', + }, + { + label: 'Football: Get Pre-Match News', + id: 'football_get_prematch_news', + group: 'Football', + }, + { + label: 'Football: Get Pre-Match News by Season', + id: 'football_get_prematch_news_by_season', + group: 'Football', + }, + { + label: 'Football: Get Pre-Match News for Upcoming Fixtures', + id: 'football_get_prematch_news_upcoming', + group: 'Football', + }, + { + label: 'Football: Get Probabilities', + id: 'football_get_probabilities', + group: 'Football', + }, + { + label: 'Football: Get Predictions by Fixture', + id: 'football_get_probabilities_by_fixture', + group: 'Football', + }, + { label: 'Football: Get Referee by ID', id: 'football_get_referee', group: 'Football' }, + { label: 'Football: Get Referees', id: 'football_get_referees', group: 'Football' }, + { + label: 'Football: Get Referees by Country', + id: 'football_get_referees_by_country', + group: 'Football', + }, + { + label: 'Football: Get Referees by Season', + id: 'football_get_referees_by_season', + group: 'Football', + }, + { + label: 'Football: Get Rivals by Team', + id: 'football_get_rivals_by_team', + group: 'Football', + }, + { label: 'Football: Get Round by ID', id: 'football_get_round', group: 'Football' }, + { + label: 'Football: Get Round Statistics', + id: 'football_get_round_statistics', + group: 'Football', + }, + { label: 'Football: Get Rounds', id: 'football_get_rounds', group: 'Football' }, + { + label: 'Football: Get Rounds by Season', + id: 'football_get_rounds_by_season', + group: 'Football', + }, + { + label: 'Football: Get Schedules by Season', + id: 'football_get_schedules_by_season', + group: 'Football', + }, + { + label: 'Football: Get Schedules by Season and Team', + id: 'football_get_schedules_by_season_and_team', + group: 'Football', + }, + { + label: 'Football: Get Schedules by Team', + id: 'football_get_schedules_by_team', + group: 'Football', + }, + { label: 'Football: Get Season by ID', id: 'football_get_season', group: 'Football' }, + { label: 'Football: Get Seasons', id: 'football_get_seasons', group: 'Football' }, + { + label: 'Football: Get Seasons by Team', + id: 'football_get_seasons_by_team', + group: 'Football', + }, + { label: 'Football: Get Stage by ID', id: 'football_get_stage', group: 'Football' }, + { + label: 'Football: Get Stage Statistics', + id: 'football_get_stage_statistics', + group: 'Football', + }, + { label: 'Football: Get Stages', id: 'football_get_stages', group: 'Football' }, + { + label: 'Football: Get Stages by Season', + id: 'football_get_stages_by_season', + group: 'Football', + }, + { + label: 'Football: Get Standing Corrections by Season', + id: 'football_get_standing_corrections_by_season', + group: 'Football', + }, + { label: 'Football: Get All Standings', id: 'football_get_standings', group: 'Football' }, + { + label: 'Football: Get Standings by Round', + id: 'football_get_standings_by_round', + group: 'Football', + }, + { + label: 'Football: Get Standings by Season', + id: 'football_get_standings_by_season', + group: 'Football', + }, + { label: 'Football: Get State by ID', id: 'football_get_state', group: 'Football' }, + { label: 'Football: Get States', id: 'football_get_states', group: 'Football' }, + { label: 'Football: Get Team by ID', id: 'football_get_team', group: 'Football' }, + { + label: 'Football: Get All Team Rankings', + id: 'football_get_team_rankings', + group: 'Football', + }, + { + label: 'Football: Get Team Rankings by Date', + id: 'football_get_team_rankings_by_date', + group: 'Football', + }, + { + label: 'Football: Get Team Rankings by Team', + id: 'football_get_team_rankings_by_team', + group: 'Football', + }, + { label: 'Football: Get Team Squad', id: 'football_get_team_squad', group: 'Football' }, + { + label: 'Football: Get Team Squad by Season', + id: 'football_get_team_squad_by_season', + group: 'Football', + }, + { + label: 'Football: Get Teams by Country', + id: 'football_get_teams_by_country', + group: 'Football', + }, + { + label: 'Football: Get Teams by Season', + id: 'football_get_teams_by_season', + group: 'Football', + }, + { + label: 'Football: Get Topscorers by Season', + id: 'football_get_topscorers_by_season', + group: 'Football', + }, + { + label: 'Football: Get Topscorers by Stage', + id: 'football_get_topscorers_by_stage', + group: 'Football', + }, + { label: 'Football: Get All Team of the Week', id: 'football_get_totw', group: 'Football' }, + { + label: 'Football: Get Team of the Week by Round', + id: 'football_get_totw_by_round', + group: 'Football', + }, + { label: 'Football: Get Transfer by ID', id: 'football_get_transfer', group: 'Football' }, + { + label: 'Football: Get Transfer Rumour by ID', + id: 'football_get_transfer_rumour', + group: 'Football', + }, + { + label: 'Football: Get Transfer Rumours Between Dates', + id: 'football_get_transfer_rumours_between_dates', + group: 'Football', + }, + { + label: 'Football: Get Transfer Rumours by Player', + id: 'football_get_transfer_rumours_by_player', + group: 'Football', + }, + { + label: 'Football: Get Transfer Rumours by Team', + id: 'football_get_transfer_rumours_by_team', + group: 'Football', + }, + { + label: 'Football: Get Transfers Between Dates', + id: 'football_get_transfers_between_dates', + group: 'Football', + }, + { + label: 'Football: Get Transfers by Player', + id: 'football_get_transfers_by_player', + group: 'Football', + }, + { + label: 'Football: Get Transfers by Team', + id: 'football_get_transfers_by_team', + group: 'Football', + }, + { + label: 'Football: Get TV Station by ID', + id: 'football_get_tv_station', + group: 'Football', + }, + { label: 'Football: Get TV Stations', id: 'football_get_tv_stations', group: 'Football' }, + { + label: 'Football: Get TV Stations by Fixture', + id: 'football_get_tv_stations_by_fixture', + group: 'Football', + }, + { + label: 'Football: Get Upcoming Fixtures by Market', + id: 'football_get_upcoming_fixtures_by_market', + group: 'Football', + }, + { + label: 'Football: Get Upcoming Fixtures by TV Station', + id: 'football_get_upcoming_fixtures_by_tv_station', + group: 'Football', + }, + { label: 'Football: Get Value Bets', id: 'football_get_value_bets', group: 'Football' }, + { + label: 'Football: Get Value Bets by Fixture', + id: 'football_get_value_bets_by_fixture', + group: 'Football', + }, + { label: 'Football: Get Venue by ID', id: 'football_get_venue', group: 'Football' }, + { label: 'Football: Get Venues', id: 'football_get_venues', group: 'Football' }, + { + label: 'Football: Get Venues by Season', + id: 'football_get_venues_by_season', + group: 'Football', + }, + { label: 'Football: Search Coaches', id: 'football_search_coaches', group: 'Football' }, + { label: 'Football: Search Fixtures', id: 'football_search_fixtures', group: 'Football' }, + { label: 'Football: Search Leagues', id: 'football_search_leagues', group: 'Football' }, + { label: 'Football: Search Players', id: 'football_search_players', group: 'Football' }, + { label: 'Football: Search Referees', id: 'football_search_referees', group: 'Football' }, + { label: 'Football: Search Rounds', id: 'football_search_rounds', group: 'Football' }, + { label: 'Football: Search Seasons', id: 'football_search_seasons', group: 'Football' }, + { label: 'Football: Search Stages', id: 'football_search_stages', group: 'Football' }, + { label: 'Football: Search Teams', id: 'football_search_teams', group: 'Football' }, + { label: 'Football: Search Venues', id: 'football_search_venues', group: 'Football' }, + { + label: 'Motorsport: Get All Fixtures', + id: 'motorsport_get_all_fixtures', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Current Leagues by Team', + id: 'motorsport_get_current_leagues_by_team', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Driver by ID', id: 'motorsport_get_driver', group: 'Motorsport' }, + { + label: 'Motorsport: Get All Driver Standings', + id: 'motorsport_get_driver_standings', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Driver Standings by Season', + id: 'motorsport_get_driver_standings_by_season', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Drivers', id: 'motorsport_get_drivers', group: 'Motorsport' }, + { + label: 'Motorsport: Get Drivers by Country', + id: 'motorsport_get_drivers_by_country', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Drivers by Season', + id: 'motorsport_get_drivers_by_season', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Fixture by ID', + id: 'motorsport_get_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Fixtures by Date', + id: 'motorsport_get_fixtures_by_date', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Fixtures by Date Range', + id: 'motorsport_get_fixtures_by_date_range', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Fixtures by IDs', + id: 'motorsport_get_fixtures_by_ids', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Laps by Fixture', + id: 'motorsport_get_laps_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Laps by Fixture and Driver', + id: 'motorsport_get_laps_by_fixture_and_driver', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Laps by Fixture and Lap Number', + id: 'motorsport_get_laps_by_fixture_and_lap', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Latest Laps by Fixture', + id: 'motorsport_get_latest_laps_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Latest Pitstops by Fixture', + id: 'motorsport_get_latest_pitstops_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Latest Stints by Fixture', + id: 'motorsport_get_latest_stints_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Latest Updated Drivers', + id: 'motorsport_get_latest_updated_drivers', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Latest Updated Fixtures', + id: 'motorsport_get_latest_updated_fixtures', + group: 'Motorsport', + }, + { label: 'Motorsport: Get League by ID', id: 'motorsport_get_league', group: 'Motorsport' }, + { label: 'Motorsport: Get All Leagues', id: 'motorsport_get_leagues', group: 'Motorsport' }, + { + label: 'Motorsport: Get Leagues by Country', + id: 'motorsport_get_leagues_by_country', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Leagues by Fixture Date', + id: 'motorsport_get_leagues_by_date', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Leagues by Live', + id: 'motorsport_get_leagues_by_live', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Leagues by Team', + id: 'motorsport_get_leagues_by_team', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Livescores', + id: 'motorsport_get_livescores', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Pitstops by Fixture', + id: 'motorsport_get_pitstops_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Pitstops by Fixture and Driver', + id: 'motorsport_get_pitstops_by_fixture_and_driver', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Pitstops by Fixture and Lap Number', + id: 'motorsport_get_pitstops_by_fixture_and_lap', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Race Results by Season and Driver', + id: 'motorsport_get_race_results_by_season_and_driver', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Race Results by Season and Team', + id: 'motorsport_get_race_results_by_season_and_team', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Schedules by Season', + id: 'motorsport_get_schedules_by_season', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Season by ID', id: 'motorsport_get_season', group: 'Motorsport' }, + { label: 'Motorsport: Get All Seasons', id: 'motorsport_get_seasons', group: 'Motorsport' }, + { label: 'Motorsport: Get Stage by ID', id: 'motorsport_get_stage', group: 'Motorsport' }, + { label: 'Motorsport: Get All Stages', id: 'motorsport_get_stages', group: 'Motorsport' }, + { + label: 'Motorsport: Get Stages by Season', + id: 'motorsport_get_stages_by_season', + group: 'Motorsport', + }, + { label: 'Motorsport: Get State by ID', id: 'motorsport_get_state', group: 'Motorsport' }, + { label: 'Motorsport: Get All States', id: 'motorsport_get_states', group: 'Motorsport' }, + { + label: 'Motorsport: Get Stints by Fixture', + id: 'motorsport_get_stints_by_fixture', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Stints by Fixture and Driver', + id: 'motorsport_get_stints_by_fixture_and_driver', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Stints by Fixture and Stint Number', + id: 'motorsport_get_stints_by_fixture_and_stint', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Team by ID', id: 'motorsport_get_team', group: 'Motorsport' }, + { + label: 'Motorsport: Get All Team Standings', + id: 'motorsport_get_team_standings', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Team Standings by Season', + id: 'motorsport_get_team_standings_by_season', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Teams', id: 'motorsport_get_teams', group: 'Motorsport' }, + { + label: 'Motorsport: Get Teams by Country', + id: 'motorsport_get_teams_by_country', + group: 'Motorsport', + }, + { + label: 'Motorsport: Get Teams by Season', + id: 'motorsport_get_teams_by_season', + group: 'Motorsport', + }, + { label: 'Motorsport: Get Venue by ID', id: 'motorsport_get_venue', group: 'Motorsport' }, + { label: 'Motorsport: Get Venues', id: 'motorsport_get_venues', group: 'Motorsport' }, + { + label: 'Motorsport: Get Venues by Season', + id: 'motorsport_get_venues_by_season', + group: 'Motorsport', + }, + { + label: 'Motorsport: Search Drivers', + id: 'motorsport_search_drivers', + group: 'Motorsport', + }, + { + label: 'Motorsport: Search Leagues', + id: 'motorsport_search_leagues', + group: 'Motorsport', + }, + { label: 'Motorsport: Search Stages', id: 'motorsport_search_stages', group: 'Motorsport' }, + { label: 'Motorsport: Search Teams', id: 'motorsport_search_teams', group: 'Motorsport' }, + { label: 'Motorsport: Search Venues', id: 'motorsport_search_venues', group: 'Motorsport' }, + { + label: 'Odds: Get All Historical Odds', + id: 'odds_get_all_historical_odds', + group: 'Odds', + }, + { label: 'Odds: Get All In-play Odds', id: 'odds_get_all_inplay_odds', group: 'Odds' }, + { label: 'Odds: Get All Pre-match Odds', id: 'odds_get_all_pre_match_odds', group: 'Odds' }, + { label: 'Odds: Get All Premium Odds', id: 'odds_get_all_premium_odds', group: 'Odds' }, + { label: 'Odds: Get Bookmaker by ID', id: 'odds_get_bookmaker', group: 'Odds' }, + { + label: 'Odds: Get Bookmaker Event IDs by Fixture', + id: 'odds_get_bookmaker_event_ids_by_fixture', + group: 'Odds', + }, + { label: 'Odds: Get Bookmakers', id: 'odds_get_bookmakers', group: 'Odds' }, + { + label: 'Odds: Get Bookmakers by Fixture', + id: 'odds_get_bookmakers_by_fixture', + group: 'Odds', + }, + { + label: 'Odds: Get In-play Odds by Fixture', + id: 'odds_get_inplay_odds_by_fixture', + group: 'Odds', + }, + { + label: 'Odds: Get In-play Odds by Fixture and Bookmaker', + id: 'odds_get_inplay_odds_by_fixture_and_bookmaker', + group: 'Odds', + }, + { + label: 'Odds: Get In-play Odds by Fixture and Market', + id: 'odds_get_inplay_odds_by_fixture_and_market', + group: 'Odds', }, { - label: 'Get Football Topscorers by Season', - id: 'football_get_topscorers_by_season', - group: 'Football', + label: 'Odds: Get Last Updated In-play Odds', + id: 'odds_get_last_updated_inplay_odds', + group: 'Odds', }, - // Motorsport { - label: 'Get Live Motorsport Scores', - id: 'motorsport_get_livescores', - group: 'Motorsport', + label: 'Odds: Get Last Updated Pre-match Odds', + id: 'odds_get_last_updated_pre_match_odds', + group: 'Odds', }, + { label: 'Odds: Get Market by ID', id: 'odds_get_market', group: 'Odds' }, + { label: 'Odds: Get Markets', id: 'odds_get_markets', group: 'Odds' }, { - label: 'Get Motorsport Fixtures by Date', - id: 'motorsport_get_fixtures_by_date', - group: 'Motorsport', + label: 'Odds: Get Pre-match Odds by Fixture', + id: 'odds_get_pre_match_odds_by_fixture', + group: 'Odds', }, { - label: 'Get Motorsport Fixture by ID', - id: 'motorsport_get_fixture', - group: 'Motorsport', + label: 'Odds: Get Pre-match Odds by Fixture and Bookmaker', + id: 'odds_get_pre_match_odds_by_fixture_and_bookmaker', + group: 'Odds', }, - { label: 'Get Motorsport Drivers', id: 'motorsport_get_drivers', group: 'Motorsport' }, - { label: 'Get Motorsport Driver by ID', id: 'motorsport_get_driver', group: 'Motorsport' }, { - label: 'Search Motorsport Drivers', - id: 'motorsport_search_drivers', - group: 'Motorsport', + label: 'Odds: Get Pre-match Odds by Fixture and Market', + id: 'odds_get_pre_match_odds_by_fixture_and_market', + group: 'Odds', }, - { label: 'Get Motorsport Teams', id: 'motorsport_get_teams', group: 'Motorsport' }, - { label: 'Get Motorsport Team by ID', id: 'motorsport_get_team', group: 'Motorsport' }, { - label: 'Get Motorsport Driver Standings by Season', - id: 'motorsport_get_driver_standings_by_season', - group: 'Motorsport', + label: 'Odds: Get Premium Odds by Fixture', + id: 'odds_get_premium_odds_by_fixture', + group: 'Odds', }, { - label: 'Get Motorsport Team Standings by Season', - id: 'motorsport_get_team_standings_by_season', - group: 'Motorsport', + label: 'Odds: Get Premium Odds by Fixture and Bookmaker', + id: 'odds_get_premium_odds_by_fixture_and_bookmaker', + group: 'Odds', }, { - label: 'Get Motorsport Laps by Fixture', - id: 'motorsport_get_laps_by_fixture', - group: 'Motorsport', + label: 'Odds: Get Premium Odds by Fixture and Market', + id: 'odds_get_premium_odds_by_fixture_and_market', + group: 'Odds', }, { - label: 'Get Motorsport Pitstops by Fixture', - id: 'motorsport_get_pitstops_by_fixture', - group: 'Motorsport', + label: 'Odds: Get Updated Historical Odds Between Time Range', + id: 'odds_get_updated_historical_odds_between', + group: 'Odds', }, - // Odds { - label: 'Get Pre-match Odds by Fixture', - id: 'odds_get_pre_match_odds_by_fixture', + label: 'Odds: Get Updated Premium Odds Between Time Range', + id: 'odds_get_updated_premium_odds_between', group: 'Odds', }, + { label: 'Odds: Search Bookmakers', id: 'odds_search_bookmakers', group: 'Odds' }, + { label: 'Odds: Search Markets', id: 'odds_search_markets', group: 'Odds' }, + { label: 'Core: Get Cities', id: 'core_get_cities', group: 'Core (Reference)' }, + { label: 'Core: Get City by ID', id: 'core_get_city', group: 'Core (Reference)' }, + { label: 'Core: Get Continent by ID', id: 'core_get_continent', group: 'Core (Reference)' }, + { label: 'Core: Get Continents', id: 'core_get_continents', group: 'Core (Reference)' }, + { label: 'Core: Get Countries', id: 'core_get_countries', group: 'Core (Reference)' }, + { label: 'Core: Get Country by ID', id: 'core_get_country', group: 'Core (Reference)' }, { - label: 'Get In-play Odds by Fixture', - id: 'odds_get_inplay_odds_by_fixture', - group: 'Odds', + label: 'Core: Get All Entity Filters', + id: 'core_get_entity_filters', + group: 'Core (Reference)', + }, + { label: 'Core: Get My Usage', id: 'core_get_my_usage', group: 'Core (Reference)' }, + { label: 'Core: Get Region by ID', id: 'core_get_region', group: 'Core (Reference)' }, + { label: 'Core: Get Regions', id: 'core_get_regions', group: 'Core (Reference)' }, + { label: 'Core: Get Timezones', id: 'core_get_timezones', group: 'Core (Reference)' }, + { label: 'Core: Get Type by ID', id: 'core_get_type', group: 'Core (Reference)' }, + { + label: 'Core: Get Type by Entity', + id: 'core_get_type_by_entity', + group: 'Core (Reference)', }, - { label: 'Get Bookmakers', id: 'odds_get_bookmakers', group: 'Odds' }, - { label: 'Get Bookmaker by ID', id: 'odds_get_bookmaker', group: 'Odds' }, - { label: 'Search Bookmakers', id: 'odds_search_bookmakers', group: 'Odds' }, - { label: 'Get Betting Markets', id: 'odds_get_markets', group: 'Odds' }, - { label: 'Get Betting Market by ID', id: 'odds_get_market', group: 'Odds' }, - { label: 'Search Betting Markets', id: 'odds_search_markets', group: 'Odds' }, - // Core reference data - { label: 'Get Continents', id: 'core_get_continents', group: 'Core (Reference)' }, - { label: 'Get Continent by ID', id: 'core_get_continent', group: 'Core (Reference)' }, - { label: 'Get Countries', id: 'core_get_countries', group: 'Core (Reference)' }, - { label: 'Get Country by ID', id: 'core_get_country', group: 'Core (Reference)' }, - { label: 'Search Countries', id: 'core_search_countries', group: 'Core (Reference)' }, - { label: 'Get Regions', id: 'core_get_regions', group: 'Core (Reference)' }, - { label: 'Get Region by ID', id: 'core_get_region', group: 'Core (Reference)' }, - { label: 'Get Cities', id: 'core_get_cities', group: 'Core (Reference)' }, - { label: 'Get City by ID', id: 'core_get_city', group: 'Core (Reference)' }, - { label: 'Search Cities', id: 'core_search_cities', group: 'Core (Reference)' }, - { label: 'Get Types', id: 'core_get_types', group: 'Core (Reference)' }, - { label: 'Get Type by ID', id: 'core_get_type', group: 'Core (Reference)' }, - { label: 'Get Timezones', id: 'core_get_timezones', group: 'Core (Reference)' }, + { label: 'Core: Get Types', id: 'core_get_types', group: 'Core (Reference)' }, + { label: 'Core: Search Cities', id: 'core_search_cities', group: 'Core (Reference)' }, + { label: 'Core: Search Countries', id: 'core_search_countries', group: 'Core (Reference)' }, + { label: 'Core: Search Regions', id: 'core_search_regions', group: 'Core (Reference)' }, ], value: () => 'football_get_fixtures_by_date', }, - // Date inputs (football + motorsport fixtures by date) + { + id: 'bookmakerId', + title: 'Bookmaker ID', + type: 'short-input', + placeholder: 'Numeric bookmaker ID', + condition: { field: 'operation', value: BOOKMAKER_ID_OPS }, + required: { field: 'operation', value: BOOKMAKER_ID_OPS }, + }, + { + id: 'cityId', + title: 'City ID', + type: 'short-input', + placeholder: 'Numeric city ID', + condition: { field: 'operation', value: CITY_ID_OPS }, + required: { field: 'operation', value: CITY_ID_OPS }, + }, + { + id: 'coachId', + title: 'Coach ID', + type: 'short-input', + placeholder: 'Numeric coach ID', + condition: { field: 'operation', value: COACH_ID_OPS }, + required: { field: 'operation', value: COACH_ID_OPS }, + }, + { + id: 'continentId', + title: 'Continent ID', + type: 'short-input', + placeholder: 'Numeric continent ID', + condition: { field: 'operation', value: CONTINENT_ID_OPS }, + required: { field: 'operation', value: CONTINENT_ID_OPS }, + }, + { + id: 'countryId', + title: 'Country ID', + type: 'short-input', + placeholder: 'Numeric country ID', + condition: { field: 'operation', value: COUNTRY_ID_OPS }, + required: { field: 'operation', value: COUNTRY_ID_OPS }, + }, { id: 'date', title: 'Date', type: 'short-input', placeholder: 'YYYY-MM-DD', - condition: { - field: 'operation', - value: ['football_get_fixtures_by_date', 'motorsport_get_fixtures_by_date'], - }, - required: { - field: 'operation', - value: ['football_get_fixtures_by_date', 'motorsport_get_fixtures_by_date'], - }, wandConfig: DATE_WAND_CONFIG, + condition: { field: 'operation', value: DATE_OPS }, + required: { field: 'operation', value: DATE_OPS }, }, { - id: 'startDate', - title: 'Start Date', + id: 'driverId', + title: 'Driver ID', type: 'short-input', - placeholder: 'YYYY-MM-DD', - condition: { field: 'operation', value: 'football_get_fixtures_by_date_range' }, - required: { field: 'operation', value: 'football_get_fixtures_by_date_range' }, - wandConfig: DATE_WAND_CONFIG, + placeholder: 'Numeric driver ID', + condition: { field: 'operation', value: DRIVER_ID_OPS }, + required: { field: 'operation', value: DRIVER_ID_OPS }, }, { id: 'endDate', title: 'End Date', type: 'short-input', - placeholder: 'YYYY-MM-DD (max 100 days after start)', - condition: { field: 'operation', value: 'football_get_fixtures_by_date_range' }, - required: { field: 'operation', value: 'football_get_fixtures_by_date_range' }, + placeholder: 'YYYY-MM-DD', wandConfig: DATE_WAND_CONFIG, + condition: { field: 'operation', value: END_DATE_OPS }, + required: { field: 'operation', value: END_DATE_OPS }, }, - // Fixture ID (football + motorsport + odds fixture operations) { id: 'fixtureId', title: 'Fixture ID', type: 'short-input', placeholder: 'Numeric fixture ID', - condition: { - field: 'operation', - value: [ - 'football_get_fixture', - 'motorsport_get_fixture', - 'motorsport_get_laps_by_fixture', - 'motorsport_get_pitstops_by_fixture', - 'odds_get_pre_match_odds_by_fixture', - 'odds_get_inplay_odds_by_fixture', - ], - }, - required: { - field: 'operation', - value: [ - 'football_get_fixture', - 'motorsport_get_fixture', - 'motorsport_get_laps_by_fixture', - 'motorsport_get_pitstops_by_fixture', - 'odds_get_pre_match_odds_by_fixture', - 'odds_get_inplay_odds_by_fixture', - ], - }, + condition: { field: 'operation', value: FIXTURE_ID_OPS }, + required: { field: 'operation', value: FIXTURE_ID_OPS }, }, - // Head to head team IDs (football) { - id: 'team1', - title: 'Team 1 ID', + id: 'fixtureIds', + title: 'Fixture IDs', type: 'short-input', - placeholder: 'First team ID', - condition: { field: 'operation', value: 'football_get_head_to_head' }, - required: { field: 'operation', value: 'football_get_head_to_head' }, + placeholder: 'Comma-separated fixture IDs', + condition: { field: 'operation', value: FIXTURE_IDS_OPS }, + required: { field: 'operation', value: FIXTURE_IDS_OPS }, }, { - id: 'team2', - title: 'Team 2 ID', + id: 'fromTimestamp', + title: 'From (UNIX timestamp)', type: 'short-input', - placeholder: 'Second team ID', - condition: { field: 'operation', value: 'football_get_head_to_head' }, - required: { field: 'operation', value: 'football_get_head_to_head' }, + placeholder: 'Start UNIX timestamp', + condition: { field: 'operation', value: FROM_TIMESTAMP_OPS }, + required: { field: 'operation', value: FROM_TIMESTAMP_OPS }, }, - // League ID (football) { - id: 'leagueId', - title: 'League ID', + id: 'ids', + title: 'IDs', type: 'short-input', - placeholder: 'Numeric league ID', - condition: { field: 'operation', value: 'football_get_league' }, - required: { field: 'operation', value: 'football_get_league' }, + placeholder: 'Comma-separated IDs', + condition: { field: 'operation', value: IDS_OPS }, + required: { field: 'operation', value: IDS_OPS }, }, - // Team ID (football + motorsport) { - id: 'teamId', - title: 'Team ID', + id: 'lapNumber', + title: 'Lap Number', type: 'short-input', - placeholder: 'Numeric team ID', - condition: { - field: 'operation', - value: ['football_get_team', 'football_get_team_squad', 'motorsport_get_team'], - }, - required: { - field: 'operation', - value: ['football_get_team', 'football_get_team_squad', 'motorsport_get_team'], - }, + placeholder: 'Numeric lap number', + condition: { field: 'operation', value: LAP_NUMBER_OPS }, + required: { field: 'operation', value: LAP_NUMBER_OPS }, }, - // Driver ID (motorsport) { - id: 'driverId', - title: 'Driver ID', + id: 'leagueId', + title: 'League ID', type: 'short-input', - placeholder: 'Numeric driver ID', - condition: { field: 'operation', value: 'motorsport_get_driver' }, - required: { field: 'operation', value: 'motorsport_get_driver' }, + placeholder: 'Numeric league ID', + condition: { field: 'operation', value: LEAGUE_ID_OPS }, + required: { field: 'operation', value: LEAGUE_ID_OPS }, + }, + { + id: 'marketId', + title: 'Market ID', + type: 'short-input', + placeholder: 'Numeric market ID', + condition: { field: 'operation', value: MARKET_ID_OPS }, + required: { field: 'operation', value: MARKET_ID_OPS }, }, - // Player ID (football) { id: 'playerId', title: 'Player ID', type: 'short-input', placeholder: 'Numeric player ID', - condition: { field: 'operation', value: 'football_get_player' }, - required: { field: 'operation', value: 'football_get_player' }, + condition: { field: 'operation', value: PLAYER_ID_OPS }, + required: { field: 'operation', value: PLAYER_ID_OPS }, + }, + { + id: 'query', + title: 'Search Query', + type: 'short-input', + placeholder: 'Name to search for', + condition: { field: 'operation', value: QUERY_OPS }, + required: { field: 'operation', value: QUERY_OPS }, + }, + { + id: 'refereeId', + title: 'Referee ID', + type: 'short-input', + placeholder: 'Numeric referee ID', + condition: { field: 'operation', value: REFEREE_ID_OPS }, + required: { field: 'operation', value: REFEREE_ID_OPS }, + }, + { + id: 'regionId', + title: 'Region ID', + type: 'short-input', + placeholder: 'Numeric region ID', + condition: { field: 'operation', value: REGION_ID_OPS }, + required: { field: 'operation', value: REGION_ID_OPS }, + }, + { + id: 'roundId', + title: 'Round ID', + type: 'short-input', + placeholder: 'Numeric round ID', + condition: { field: 'operation', value: ROUND_ID_OPS }, + required: { field: 'operation', value: ROUND_ID_OPS }, + }, + { + id: 'rumourId', + title: 'Rumour ID', + type: 'short-input', + placeholder: 'Numeric transfer rumour ID', + condition: { field: 'operation', value: RUMOUR_ID_OPS }, + required: { field: 'operation', value: RUMOUR_ID_OPS }, }, - // Season ID (football + motorsport standings/topscorers) { id: 'seasonId', title: 'Season ID', type: 'short-input', placeholder: 'Numeric season ID', - condition: { - field: 'operation', - value: [ - 'football_get_standings_by_season', - 'football_get_topscorers_by_season', - 'motorsport_get_driver_standings_by_season', - 'motorsport_get_team_standings_by_season', - ], - }, - required: { - field: 'operation', - value: [ - 'football_get_standings_by_season', - 'football_get_topscorers_by_season', - 'motorsport_get_driver_standings_by_season', - 'motorsport_get_team_standings_by_season', - ], - }, + condition: { field: 'operation', value: SEASON_ID_OPS }, + required: { field: 'operation', value: SEASON_ID_OPS }, }, - // Bookmaker / Market IDs (odds) { - id: 'bookmakerId', - title: 'Bookmaker ID', + id: 'stageId', + title: 'Stage ID', type: 'short-input', - placeholder: 'Numeric bookmaker ID', - condition: { field: 'operation', value: 'odds_get_bookmaker' }, - required: { field: 'operation', value: 'odds_get_bookmaker' }, + placeholder: 'Numeric stage ID', + condition: { field: 'operation', value: STAGE_ID_OPS }, + required: { field: 'operation', value: STAGE_ID_OPS }, }, { - id: 'marketId', - title: 'Market ID', + id: 'startDate', + title: 'Start Date', type: 'short-input', - placeholder: 'Numeric market ID', - condition: { field: 'operation', value: 'odds_get_market' }, - required: { field: 'operation', value: 'odds_get_market' }, + placeholder: 'YYYY-MM-DD', + wandConfig: DATE_WAND_CONFIG, + condition: { field: 'operation', value: START_DATE_OPS }, + required: { field: 'operation', value: START_DATE_OPS }, }, - // Core reference IDs { - id: 'continentId', - title: 'Continent ID', + id: 'stateId', + title: 'State ID', type: 'short-input', - placeholder: 'Numeric continent ID', - condition: { field: 'operation', value: 'core_get_continent' }, - required: { field: 'operation', value: 'core_get_continent' }, + placeholder: 'Numeric state ID', + condition: { field: 'operation', value: STATE_ID_OPS }, + required: { field: 'operation', value: STATE_ID_OPS }, }, { - id: 'countryId', - title: 'Country ID', + id: 'stintNumber', + title: 'Stint Number', type: 'short-input', - placeholder: 'Numeric country ID', - condition: { field: 'operation', value: 'core_get_country' }, - required: { field: 'operation', value: 'core_get_country' }, + placeholder: 'Numeric stint number', + condition: { field: 'operation', value: STINT_NUMBER_OPS }, + required: { field: 'operation', value: STINT_NUMBER_OPS }, }, { - id: 'regionId', - title: 'Region ID', + id: 'team1', + title: 'Team 1 ID', type: 'short-input', - placeholder: 'Numeric region ID', - condition: { field: 'operation', value: 'core_get_region' }, - required: { field: 'operation', value: 'core_get_region' }, + placeholder: 'First team ID', + condition: { field: 'operation', value: TEAM_1_OPS }, + required: { field: 'operation', value: TEAM_1_OPS }, }, { - id: 'cityId', - title: 'City ID', + id: 'team2', + title: 'Team 2 ID', type: 'short-input', - placeholder: 'Numeric city ID', - condition: { field: 'operation', value: 'core_get_city' }, - required: { field: 'operation', value: 'core_get_city' }, + placeholder: 'Second team ID', + condition: { field: 'operation', value: TEAM_2_OPS }, + required: { field: 'operation', value: TEAM_2_OPS }, + }, + { + id: 'teamId', + title: 'Team ID', + type: 'short-input', + placeholder: 'Numeric team ID', + condition: { field: 'operation', value: TEAM_ID_OPS }, + required: { field: 'operation', value: TEAM_ID_OPS }, + }, + { + id: 'toTimestamp', + title: 'To (UNIX timestamp)', + type: 'short-input', + placeholder: 'End UNIX timestamp', + condition: { field: 'operation', value: TO_TIMESTAMP_OPS }, + required: { field: 'operation', value: TO_TIMESTAMP_OPS }, + }, + { + id: 'transferId', + title: 'Transfer ID', + type: 'short-input', + placeholder: 'Numeric transfer ID', + condition: { field: 'operation', value: TRANSFER_ID_OPS }, + required: { field: 'operation', value: TRANSFER_ID_OPS }, + }, + { + id: 'tvStationId', + title: 'TV Station ID', + type: 'short-input', + placeholder: 'Numeric TV station ID', + condition: { field: 'operation', value: TV_STATION_ID_OPS }, + required: { field: 'operation', value: TV_STATION_ID_OPS }, }, { id: 'typeId', title: 'Type ID', type: 'short-input', placeholder: 'Numeric type ID', - condition: { field: 'operation', value: 'core_get_type' }, - required: { field: 'operation', value: 'core_get_type' }, + condition: { field: 'operation', value: TYPE_ID_OPS }, + required: { field: 'operation', value: TYPE_ID_OPS }, }, - // Shared search query { - id: 'query', - title: 'Search Query', + id: 'venueId', + title: 'Venue ID', type: 'short-input', - placeholder: 'Name to search for', - condition: { - field: 'operation', - value: [ - 'football_search_teams', - 'football_search_players', - 'motorsport_search_drivers', - 'odds_search_bookmakers', - 'odds_search_markets', - 'core_search_countries', - 'core_search_cities', - ], - }, - required: { - field: 'operation', - value: [ - 'football_search_teams', - 'football_search_players', - 'motorsport_search_drivers', - 'odds_search_bookmakers', - 'odds_search_markets', - 'core_search_countries', - 'core_search_cities', - ], - }, + placeholder: 'Numeric venue ID', + condition: { field: 'operation', value: VENUE_ID_OPS }, + required: { field: 'operation', value: VENUE_ID_OPS }, }, - // Shared enrichment + pagination (advanced) { id: 'include', title: 'Includes', @@ -529,54 +1925,227 @@ export const SportmonksBlock: BlockConfig = { ], tools: { access: [ - 'sportmonks_football_get_livescores', - 'sportmonks_football_get_inplay_livescores', + 'sportmonks_football_expected_by_player', + 'sportmonks_football_expected_by_team', + 'sportmonks_football_get_all_commentaries', + 'sportmonks_football_get_all_fixtures', + 'sportmonks_football_get_all_players', + 'sportmonks_football_get_all_rivals', + 'sportmonks_football_get_all_teams', + 'sportmonks_football_get_all_transfer_rumours', + 'sportmonks_football_get_all_transfers', + 'sportmonks_football_get_brackets_by_season', + 'sportmonks_football_get_coach', + 'sportmonks_football_get_coaches', + 'sportmonks_football_get_coaches_by_country', + 'sportmonks_football_get_commentaries_by_fixture', + 'sportmonks_football_get_current_leagues_by_team', + 'sportmonks_football_get_expected_lineups_by_player', + 'sportmonks_football_get_expected_lineups_by_team', + 'sportmonks_football_get_extended_team_squad', + 'sportmonks_football_get_fixture', 'sportmonks_football_get_fixtures_by_date', 'sportmonks_football_get_fixtures_by_date_range', - 'sportmonks_football_get_fixture', + 'sportmonks_football_get_fixtures_by_date_range_for_team', + 'sportmonks_football_get_fixtures_by_ids', + 'sportmonks_football_get_grouped_standings_by_round', 'sportmonks_football_get_head_to_head', - 'sportmonks_football_get_leagues', + 'sportmonks_football_get_inplay_livescores', + 'sportmonks_football_get_latest_coaches', + 'sportmonks_football_get_latest_fixtures', + 'sportmonks_football_get_latest_livescores', + 'sportmonks_football_get_latest_players', + 'sportmonks_football_get_latest_totw', + 'sportmonks_football_get_latest_transfers', 'sportmonks_football_get_league', - 'sportmonks_football_search_teams', - 'sportmonks_football_get_team', - 'sportmonks_football_get_team_squad', - 'sportmonks_football_search_players', + 'sportmonks_football_get_leagues', + 'sportmonks_football_get_leagues_by_country', + 'sportmonks_football_get_leagues_by_date', + 'sportmonks_football_get_leagues_by_team', + 'sportmonks_football_get_live_leagues', + 'sportmonks_football_get_live_probabilities', + 'sportmonks_football_get_live_probabilities_by_fixture', + 'sportmonks_football_get_live_standings_by_league', + 'sportmonks_football_get_livescores', + 'sportmonks_football_get_match_facts', + 'sportmonks_football_get_match_facts_by_date_range', + 'sportmonks_football_get_match_facts_by_fixture', + 'sportmonks_football_get_match_facts_by_league', + 'sportmonks_football_get_past_fixtures_by_tv_station', 'sportmonks_football_get_player', + 'sportmonks_football_get_players_by_country', + 'sportmonks_football_get_postmatch_news', + 'sportmonks_football_get_postmatch_news_by_season', + 'sportmonks_football_get_predictability_by_league', + 'sportmonks_football_get_prematch_news', + 'sportmonks_football_get_prematch_news_by_season', + 'sportmonks_football_get_prematch_news_upcoming', + 'sportmonks_football_get_probabilities', + 'sportmonks_football_get_probabilities_by_fixture', + 'sportmonks_football_get_referee', + 'sportmonks_football_get_referees', + 'sportmonks_football_get_referees_by_country', + 'sportmonks_football_get_referees_by_season', + 'sportmonks_football_get_rivals_by_team', + 'sportmonks_football_get_round', + 'sportmonks_football_get_round_statistics', + 'sportmonks_football_get_rounds', + 'sportmonks_football_get_rounds_by_season', + 'sportmonks_football_get_schedules_by_season', + 'sportmonks_football_get_schedules_by_season_and_team', + 'sportmonks_football_get_schedules_by_team', + 'sportmonks_football_get_season', + 'sportmonks_football_get_seasons', + 'sportmonks_football_get_seasons_by_team', + 'sportmonks_football_get_stage', + 'sportmonks_football_get_stage_statistics', + 'sportmonks_football_get_stages', + 'sportmonks_football_get_stages_by_season', + 'sportmonks_football_get_standing_corrections_by_season', + 'sportmonks_football_get_standings', + 'sportmonks_football_get_standings_by_round', 'sportmonks_football_get_standings_by_season', + 'sportmonks_football_get_state', + 'sportmonks_football_get_states', + 'sportmonks_football_get_team', + 'sportmonks_football_get_team_rankings', + 'sportmonks_football_get_team_rankings_by_date', + 'sportmonks_football_get_team_rankings_by_team', + 'sportmonks_football_get_team_squad', + 'sportmonks_football_get_team_squad_by_season', + 'sportmonks_football_get_teams_by_country', + 'sportmonks_football_get_teams_by_season', 'sportmonks_football_get_topscorers_by_season', - 'sportmonks_motorsport_get_livescores', - 'sportmonks_motorsport_get_fixtures_by_date', - 'sportmonks_motorsport_get_fixture', - 'sportmonks_motorsport_get_drivers', + 'sportmonks_football_get_topscorers_by_stage', + 'sportmonks_football_get_totw', + 'sportmonks_football_get_totw_by_round', + 'sportmonks_football_get_transfer', + 'sportmonks_football_get_transfer_rumour', + 'sportmonks_football_get_transfer_rumours_between_dates', + 'sportmonks_football_get_transfer_rumours_by_player', + 'sportmonks_football_get_transfer_rumours_by_team', + 'sportmonks_football_get_transfers_between_dates', + 'sportmonks_football_get_transfers_by_player', + 'sportmonks_football_get_transfers_by_team', + 'sportmonks_football_get_tv_station', + 'sportmonks_football_get_tv_stations', + 'sportmonks_football_get_tv_stations_by_fixture', + 'sportmonks_football_get_upcoming_fixtures_by_market', + 'sportmonks_football_get_upcoming_fixtures_by_tv_station', + 'sportmonks_football_get_value_bets', + 'sportmonks_football_get_value_bets_by_fixture', + 'sportmonks_football_get_venue', + 'sportmonks_football_get_venues', + 'sportmonks_football_get_venues_by_season', + 'sportmonks_football_search_coaches', + 'sportmonks_football_search_fixtures', + 'sportmonks_football_search_leagues', + 'sportmonks_football_search_players', + 'sportmonks_football_search_referees', + 'sportmonks_football_search_rounds', + 'sportmonks_football_search_seasons', + 'sportmonks_football_search_stages', + 'sportmonks_football_search_teams', + 'sportmonks_football_search_venues', + 'sportmonks_motorsport_get_all_fixtures', + 'sportmonks_motorsport_get_current_leagues_by_team', 'sportmonks_motorsport_get_driver', - 'sportmonks_motorsport_search_drivers', - 'sportmonks_motorsport_get_teams', - 'sportmonks_motorsport_get_team', + 'sportmonks_motorsport_get_driver_standings', 'sportmonks_motorsport_get_driver_standings_by_season', - 'sportmonks_motorsport_get_team_standings_by_season', + 'sportmonks_motorsport_get_drivers', + 'sportmonks_motorsport_get_drivers_by_country', + 'sportmonks_motorsport_get_drivers_by_season', + 'sportmonks_motorsport_get_fixture', + 'sportmonks_motorsport_get_fixtures_by_date', + 'sportmonks_motorsport_get_fixtures_by_date_range', + 'sportmonks_motorsport_get_fixtures_by_ids', 'sportmonks_motorsport_get_laps_by_fixture', + 'sportmonks_motorsport_get_laps_by_fixture_and_driver', + 'sportmonks_motorsport_get_laps_by_fixture_and_lap', + 'sportmonks_motorsport_get_latest_laps_by_fixture', + 'sportmonks_motorsport_get_latest_pitstops_by_fixture', + 'sportmonks_motorsport_get_latest_stints_by_fixture', + 'sportmonks_motorsport_get_latest_updated_drivers', + 'sportmonks_motorsport_get_latest_updated_fixtures', + 'sportmonks_motorsport_get_league', + 'sportmonks_motorsport_get_leagues', + 'sportmonks_motorsport_get_leagues_by_country', + 'sportmonks_motorsport_get_leagues_by_date', + 'sportmonks_motorsport_get_leagues_by_live', + 'sportmonks_motorsport_get_leagues_by_team', + 'sportmonks_motorsport_get_livescores', 'sportmonks_motorsport_get_pitstops_by_fixture', - 'sportmonks_odds_get_pre_match_odds_by_fixture', - 'sportmonks_odds_get_inplay_odds_by_fixture', - 'sportmonks_odds_get_bookmakers', + 'sportmonks_motorsport_get_pitstops_by_fixture_and_driver', + 'sportmonks_motorsport_get_pitstops_by_fixture_and_lap', + 'sportmonks_motorsport_get_race_results_by_season_and_driver', + 'sportmonks_motorsport_get_race_results_by_season_and_team', + 'sportmonks_motorsport_get_schedules_by_season', + 'sportmonks_motorsport_get_season', + 'sportmonks_motorsport_get_seasons', + 'sportmonks_motorsport_get_stage', + 'sportmonks_motorsport_get_stages', + 'sportmonks_motorsport_get_stages_by_season', + 'sportmonks_motorsport_get_state', + 'sportmonks_motorsport_get_states', + 'sportmonks_motorsport_get_stints_by_fixture', + 'sportmonks_motorsport_get_stints_by_fixture_and_driver', + 'sportmonks_motorsport_get_stints_by_fixture_and_stint', + 'sportmonks_motorsport_get_team', + 'sportmonks_motorsport_get_team_standings', + 'sportmonks_motorsport_get_team_standings_by_season', + 'sportmonks_motorsport_get_teams', + 'sportmonks_motorsport_get_teams_by_country', + 'sportmonks_motorsport_get_teams_by_season', + 'sportmonks_motorsport_get_venue', + 'sportmonks_motorsport_get_venues', + 'sportmonks_motorsport_get_venues_by_season', + 'sportmonks_motorsport_search_drivers', + 'sportmonks_motorsport_search_leagues', + 'sportmonks_motorsport_search_stages', + 'sportmonks_motorsport_search_teams', + 'sportmonks_motorsport_search_venues', + 'sportmonks_odds_get_all_historical_odds', + 'sportmonks_odds_get_all_inplay_odds', + 'sportmonks_odds_get_all_pre_match_odds', + 'sportmonks_odds_get_all_premium_odds', 'sportmonks_odds_get_bookmaker', - 'sportmonks_odds_search_bookmakers', - 'sportmonks_odds_get_markets', + 'sportmonks_odds_get_bookmaker_event_ids_by_fixture', + 'sportmonks_odds_get_bookmakers', + 'sportmonks_odds_get_bookmakers_by_fixture', + 'sportmonks_odds_get_inplay_odds_by_fixture', + 'sportmonks_odds_get_inplay_odds_by_fixture_and_bookmaker', + 'sportmonks_odds_get_inplay_odds_by_fixture_and_market', + 'sportmonks_odds_get_last_updated_inplay_odds', + 'sportmonks_odds_get_last_updated_pre_match_odds', 'sportmonks_odds_get_market', + 'sportmonks_odds_get_markets', + 'sportmonks_odds_get_pre_match_odds_by_fixture', + 'sportmonks_odds_get_pre_match_odds_by_fixture_and_bookmaker', + 'sportmonks_odds_get_pre_match_odds_by_fixture_and_market', + 'sportmonks_odds_get_premium_odds_by_fixture', + 'sportmonks_odds_get_premium_odds_by_fixture_and_bookmaker', + 'sportmonks_odds_get_premium_odds_by_fixture_and_market', + 'sportmonks_odds_get_updated_historical_odds_between', + 'sportmonks_odds_get_updated_premium_odds_between', + 'sportmonks_odds_search_bookmakers', 'sportmonks_odds_search_markets', - 'sportmonks_core_get_continents', + 'sportmonks_core_get_cities', + 'sportmonks_core_get_city', 'sportmonks_core_get_continent', + 'sportmonks_core_get_continents', 'sportmonks_core_get_countries', 'sportmonks_core_get_country', - 'sportmonks_core_search_countries', - 'sportmonks_core_get_regions', + 'sportmonks_core_get_entity_filters', + 'sportmonks_core_get_my_usage', 'sportmonks_core_get_region', - 'sportmonks_core_get_cities', - 'sportmonks_core_get_city', - 'sportmonks_core_search_cities', - 'sportmonks_core_get_types', - 'sportmonks_core_get_type', + 'sportmonks_core_get_regions', 'sportmonks_core_get_timezones', + 'sportmonks_core_get_type', + 'sportmonks_core_get_type_by_entity', + 'sportmonks_core_get_types', + 'sportmonks_core_search_cities', + 'sportmonks_core_search_countries', + 'sportmonks_core_search_regions', ], config: { tool: (params) => `sportmonks_${params.operation}`, @@ -595,25 +2164,40 @@ export const SportmonksBlock: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Sportmonks API token' }, - date: { type: 'string', description: 'Date in YYYY-MM-DD format' }, - startDate: { type: 'string', description: 'Start date in YYYY-MM-DD format' }, - endDate: { type: 'string', description: 'End date in YYYY-MM-DD format' }, - fixtureId: { type: 'string', description: 'Fixture (session) ID' }, - team1: { type: 'string', description: 'First team ID for head-to-head' }, - team2: { type: 'string', description: 'Second team ID for head-to-head' }, - leagueId: { type: 'string', description: 'League ID' }, - teamId: { type: 'string', description: 'Team ID' }, - driverId: { type: 'string', description: 'Driver ID' }, - playerId: { type: 'string', description: 'Player ID' }, - seasonId: { type: 'string', description: 'Season ID' }, bookmakerId: { type: 'string', description: 'Bookmaker ID' }, - marketId: { type: 'string', description: 'Market ID' }, + cityId: { type: 'string', description: 'City ID' }, + coachId: { type: 'string', description: 'Coach ID' }, continentId: { type: 'string', description: 'Continent ID' }, countryId: { type: 'string', description: 'Country ID' }, + date: { type: 'string', description: 'Date' }, + driverId: { type: 'string', description: 'Driver ID' }, + endDate: { type: 'string', description: 'End Date' }, + fixtureId: { type: 'string', description: 'Fixture ID' }, + fixtureIds: { type: 'string', description: 'Fixture IDs' }, + fromTimestamp: { type: 'string', description: 'From (UNIX timestamp)' }, + ids: { type: 'string', description: 'IDs' }, + lapNumber: { type: 'string', description: 'Lap Number' }, + leagueId: { type: 'string', description: 'League ID' }, + marketId: { type: 'string', description: 'Market ID' }, + playerId: { type: 'string', description: 'Player ID' }, + query: { type: 'string', description: 'Search Query' }, + refereeId: { type: 'string', description: 'Referee ID' }, regionId: { type: 'string', description: 'Region ID' }, - cityId: { type: 'string', description: 'City ID' }, + roundId: { type: 'string', description: 'Round ID' }, + rumourId: { type: 'string', description: 'Rumour ID' }, + seasonId: { type: 'string', description: 'Season ID' }, + stageId: { type: 'string', description: 'Stage ID' }, + startDate: { type: 'string', description: 'Start Date' }, + stateId: { type: 'string', description: 'State ID' }, + stintNumber: { type: 'string', description: 'Stint Number' }, + team1: { type: 'string', description: 'Team 1 ID' }, + team2: { type: 'string', description: 'Team 2 ID' }, + teamId: { type: 'string', description: 'Team ID' }, + toTimestamp: { type: 'string', description: 'To (UNIX timestamp)' }, + transferId: { type: 'string', description: 'Transfer ID' }, + tvStationId: { type: 'string', description: 'TV Station ID' }, typeId: { type: 'string', description: 'Type ID' }, - query: { type: 'string', description: 'Search query' }, + venueId: { type: 'string', description: 'Venue ID' }, include: { type: 'string', description: 'Semicolon-separated relations to include' }, filters: { type: 'string', description: 'Filters to apply' }, per_page: { type: 'string', description: 'Results per page (max 50)' }, @@ -621,59 +2205,80 @@ export const SportmonksBlock: BlockConfig = { order: { type: 'string', description: 'Order direction (asc or desc)' }, }, outputs: { - // Football + Motorsport fixtures - fixtures: { - type: 'json', - description: - 'Array of fixtures/sessions [{id, name, starting_at, league_id, season_id, state_id}] — football and motorsport', - }, - fixture: { type: 'json', description: 'Single fixture/session object' }, - // Football - leagues: { type: 'json', description: 'Array of football leagues' }, - league: { type: 'json', description: 'Single football league object' }, - teams: { type: 'json', description: 'Array of teams (football or motorsport)' }, - team: { type: 'json', description: 'Single team object (football or motorsport)' }, - squad: { type: 'json', description: 'Array of football squad entries' }, - players: { type: 'json', description: 'Array of football players' }, - player: { type: 'json', description: 'Single football player object' }, - standings: { - type: 'json', - description: 'Array of standings (football league or motorsport championship)', - }, - topscorers: { type: 'json', description: 'Array of football topscorers' }, - // Motorsport - drivers: { type: 'json', description: 'Array of motorsport drivers' }, - driver: { type: 'json', description: 'Single motorsport driver object' }, - laps: { type: 'json', description: 'Array of motorsport laps' }, - pitstops: { type: 'json', description: 'Array of motorsport pitstops' }, - // Odds - odds: { - type: 'json', - description: - 'Array of odds [{id, fixture_id, market_id, bookmaker_id, label, value, probability}]', - }, - bookmakers: { type: 'json', description: 'Array of bookmakers [{id, name, logo}]' }, bookmaker: { type: 'json', description: 'Single bookmaker object' }, - markets: { type: 'json', description: 'Array of betting markets [{id, name}]' }, - market: { type: 'json', description: 'Single betting market object' }, - // Core reference - continents: { type: 'json', description: 'Array of continents [{id, name, code}]' }, + bookmakerEvents: { type: 'json', description: 'Array of bookmakerEvents' }, + bookmakers: { type: 'json', description: 'Array of bookmakers' }, + brackets: { type: 'json', description: 'brackets (JSON)' }, + cities: { type: 'json', description: 'Array of cities' }, + city: { type: 'json', description: 'Single city object' }, + coach: { type: 'json', description: 'Single coach object' }, + coaches: { type: 'json', description: 'Array of coaches' }, + commentaries: { type: 'json', description: 'Array of commentaries' }, continent: { type: 'json', description: 'Single continent object' }, - countries: { - type: 'json', - description: 'Array of countries [{id, name, iso2, iso3, image_path}]', - }, + continents: { type: 'json', description: 'Array of continents' }, + corrections: { type: 'json', description: 'Array of corrections' }, + countries: { type: 'json', description: 'Array of countries' }, country: { type: 'json', description: 'Single country object' }, - regions: { type: 'json', description: 'Array of regions [{id, country_id, name}]' }, + driver: { type: 'json', description: 'Single driver object' }, + drivers: { type: 'json', description: 'Array of drivers' }, + entityFilters: { type: 'json', description: 'entityFilters (JSON)' }, + expected: { type: 'json', description: 'Array of expected' }, + expectedLineups: { type: 'json', description: 'Array of expectedLineups' }, + fixture: { type: 'json', description: 'Single fixture object' }, + fixtures: { type: 'json', description: 'Array of fixtures' }, + historicalOdds: { type: 'json', description: 'Array of historicalOdds' }, + laps: { type: 'json', description: 'Array of laps' }, + league: { type: 'json', description: 'Single league object' }, + leagues: { type: 'json', description: 'Array of leagues' }, + market: { type: 'json', description: 'Single market object' }, + markets: { type: 'json', description: 'Array of markets' }, + matchFacts: { type: 'json', description: 'Array of matchFacts' }, + news: { type: 'json', description: 'Array of news' }, + odds: { type: 'json', description: 'Array of odds' }, + pitstops: { type: 'json', description: 'Array of pitstops' }, + player: { type: 'json', description: 'Single player object' }, + players: { type: 'json', description: 'Array of players' }, + predictability: { type: 'json', description: 'Array of predictability' }, + predictions: { type: 'json', description: 'Array of predictions' }, + premiumOdds: { type: 'json', description: 'Array of premiumOdds' }, + referee: { type: 'json', description: 'Single referee object' }, + referees: { type: 'json', description: 'Array of referees' }, region: { type: 'json', description: 'Single region object' }, - cities: { type: 'json', description: 'Array of cities [{id, country_id, name}]' }, - city: { type: 'json', description: 'Single city object' }, - types: { - type: 'json', - description: 'Array of types [{id, name, code, developer_name, group}]', - }, + regions: { type: 'json', description: 'Array of regions' }, + results: { type: 'json', description: 'Array of results' }, + rivals: { type: 'json', description: 'Array of rivals' }, + round: { type: 'json', description: 'Single round object' }, + rounds: { type: 'json', description: 'Array of rounds' }, + schedules: { type: 'json', description: 'Array of schedules' }, + season: { type: 'json', description: 'Single season object' }, + seasons: { type: 'json', description: 'Array of seasons' }, + squad: { type: 'json', description: 'Array of squad' }, + stage: { type: 'json', description: 'Single stage object' }, + stages: { type: 'json', description: 'Array of stages' }, + standings: { type: 'json', description: 'Array of standings' }, + state: { type: 'json', description: 'Single state object' }, + states: { type: 'json', description: 'Array of states' }, + statistics: { type: 'json', description: 'Array of statistics' }, + stints: { type: 'json', description: 'Array of stints' }, + team: { type: 'json', description: 'Single team object' }, + teamRankings: { type: 'json', description: 'Array of teamRankings' }, + teams: { type: 'json', description: 'Array of teams' }, + timezones: { type: 'json', description: 'Array of timezones' }, + topscorers: { type: 'json', description: 'Array of topscorers' }, + totw: { type: 'json', description: 'Array of totw' }, + transfer: { type: 'json', description: 'Single transfer object' }, + transferRumour: { type: 'json', description: 'Single transferRumour object' }, + transferRumours: { type: 'json', description: 'Array of transferRumours' }, + transfers: { type: 'json', description: 'Array of transfers' }, + tvStation: { type: 'json', description: 'Single tvStation object' }, + tvStations: { type: 'json', description: 'Array of tvStations' }, type: { type: 'json', description: 'Single type object' }, - timezones: { type: 'json', description: 'Array of IANA time zone name strings' }, + types: { type: 'json', description: 'Array of types' }, + typesByEntity: { type: 'json', description: 'typesByEntity (JSON)' }, + usage: { type: 'json', description: 'Array of usage' }, + valueBets: { type: 'json', description: 'Array of valueBets' }, + venue: { type: 'json', description: 'Single venue object' }, + venues: { type: 'json', description: 'Array of venues' }, pagination: { type: 'json', description: 'Pagination metadata {count, per_page, current_page, next_page, has_more}', diff --git a/apps/sim/lib/integrations/integrations.json b/apps/sim/lib/integrations/integrations.json index ad85368dcfa..cf2683bc099 100644 --- a/apps/sim/lib/integrations/integrations.json +++ b/apps/sim/lib/integrations/integrations.json @@ -14936,205 +14936,897 @@ "slug": "sportmonks", "name": "Sportmonks", "description": "Access Sportmonks football, motorsport, odds, and reference data", - "longDescription": "Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, teams, squads, players, standings, and topscorers. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones.", + "longDescription": "Integrate the Sportmonks sports data APIs into the workflow from a single block. Football: fixtures, livescores, leagues, seasons, stages, rounds, teams, squads, players, coaches, referees, venues, standings, topscorers, transfers, schedules, commentaries, TV stations, rivals, expected goals (xG), and predictions. Motorsport: sessions, drivers, teams, championship standings, laps, and pitstops. Odds: pre-match and in-play odds, bookmakers, and markets. Core: continents, countries, regions, cities, types, and time zones.", "bgColor": "#171534", "iconName": "SportmonksIcon", "docsUrl": "https://docs.sim.ai/integrations/sportmonks", "operations": [ { - "name": "Get Live Football Scores", - "description": "Retrieve fixtures starting within 15 minutes and currently in progress from Sportmonks" + "name": "Football: Get Expected xG by Player", + "description": "Retrieve lineup-level expected goals (xG) values per player from Sportmonks" }, { - "name": "Get Inplay Football Scores", - "description": "Retrieve all fixtures that are currently being played (in-play) from Sportmonks" + "name": "Football: Get Expected xG by Team", + "description": "Retrieve fixture-level expected goals (xG) values per team from Sportmonks" + }, + { + "name": "Football: Get All Commentaries", + "description": "Retrieve all textual commentaries available within your Sportmonks subscription" + }, + { + "name": "Football: Get All Fixtures", + "description": "Retrieve all football fixtures available within your Sportmonks subscription" + }, + { + "name": "Football: Get All Players", + "description": "Retrieve all football players available within your Sportmonks subscription" + }, + { + "name": "Football: Get All Rivals", + "description": "Retrieve all teams with their rivals information from Sportmonks" + }, + { + "name": "Football: Get All Teams", + "description": "Retrieve all football teams available within your Sportmonks subscription" + }, + { + "name": "Football: Get All Transfer Rumours", + "description": "Retrieve all transfer rumours available within your Sportmonks subscription" + }, + { + "name": "Football: Get All Transfers", + "description": "Retrieve all transfers available within your Sportmonks subscription" + }, + { + "name": "Football: Get Brackets by Season", + "description": "Retrieve the knockout-stage tournament bracket (stages and progression edges) for a season ID" + }, + { + "name": "Football: Get Coach by ID", + "description": "Retrieve a single football coach by their ID from Sportmonks" + }, + { + "name": "Football: Get Coaches", + "description": "Retrieve all football coaches available within your Sportmonks subscription" + }, + { + "name": "Football: Get Coaches by Country", + "description": "Retrieve all coaches for a country ID from Sportmonks" + }, + { + "name": "Football: Get Commentaries by Fixture", + "description": "Retrieve textual commentary for a fixture by fixture ID from Sportmonks" }, { - "name": "Get Football Fixtures by Date", + "name": "Football: Get Current Leagues by Team", + "description": "Retrieve all current leagues for a team ID from Sportmonks" + }, + { + "name": "Football: Get Expected Lineups by Player", + "description": "Retrieve the premium expected lineups for a player ID from Sportmonks" + }, + { + "name": "Football: Get Expected Lineups by Team", + "description": "Retrieve the premium expected lineups for a team ID from Sportmonks" + }, + { + "name": "Football: Get Extended Team Squad", + "description": "Retrieve all squad entries for a team (based on current seasons) by team ID" + }, + { + "name": "Football: Get Fixture by ID", + "description": "Retrieve a single football fixture by its ID from Sportmonks" + }, + { + "name": "Football: Get Fixtures by Date", "description": "Retrieve all football fixtures on a specific date (YYYY-MM-DD) from Sportmonks" }, { - "name": "Get Football Fixtures by Date Range", + "name": "Football: Get Fixtures by Date Range", "description": "Retrieve football fixtures between two dates (YYYY-MM-DD) from Sportmonks. Max range is 100 days." }, { - "name": "Get Football Fixture by ID", - "description": "Retrieve a single football fixture by its ID from Sportmonks" + "name": "Football: Get Fixtures by Date Range for Team", + "description": "Retrieve fixtures for a team within a date range (YYYY-MM-DD) from Sportmonks" }, { - "name": "Get Football Head to Head", + "name": "Football: Get Fixtures by Multiple IDs", + "description": "Retrieve multiple football fixtures by a comma-separated list of IDs (max 50)" + }, + { + "name": "Football: Get Grouped Standings by Round", + "description": "Retrieve the standing table for a round ID grouped by group where applicable from Sportmonks" + }, + { + "name": "Football: Get Head to Head", "description": "Retrieve the head-to-head fixtures between two teams from Sportmonks" }, { - "name": "Get Football Leagues", - "description": "Retrieve all football leagues available within your Sportmonks subscription" + "name": "Football: Get Inplay Livescores", + "description": "Retrieve all fixtures that are currently being played (in-play) from Sportmonks" + }, + { + "name": "Football: Get Last Updated Coaches", + "description": "Retrieve all coaches that have received updates in the past two hours" + }, + { + "name": "Football: Get Latest Updated Fixtures", + "description": "Retrieve all fixtures that have received updates within the last 10 seconds" + }, + { + "name": "Football: Get Latest Updated Livescores", + "description": "Retrieve all livescores that have received updates within the last 10 seconds" + }, + { + "name": "Football: Get Last Updated Players", + "description": "Retrieve all players that have received updates in the past two hours" + }, + { + "name": "Football: Get Latest Team of the Week", + "description": "Retrieve the latest Team of the Week (TOTW) for a league ID from Sportmonks" }, { - "name": "Get Football League by ID", + "name": "Football: Get Latest Transfers", + "description": "Retrieve the latest transfers available within your Sportmonks subscription" + }, + { + "name": "Football: Get League by ID", "description": "Retrieve a single football league by its ID from Sportmonks" }, { - "name": "Search Football Teams", - "description": "Search for football teams by name from Sportmonks" + "name": "Football: Get Leagues", + "description": "Retrieve all football leagues available within your Sportmonks subscription" }, { - "name": "Get Football Team by ID", - "description": "Retrieve a single football team by its ID from Sportmonks" + "name": "Football: Get Leagues by Country", + "description": "Retrieve all leagues for a country ID from Sportmonks" }, { - "name": "Get Football Team Squad", - "description": "Retrieve the current domestic squad for a team by team ID from Sportmonks" + "name": "Football: Get Leagues by Date", + "description": "Retrieve all leagues with fixtures on a given date (YYYY-MM-DD) from Sportmonks" }, { - "name": "Search Football Players", - "description": "Search for football players by name from Sportmonks" + "name": "Football: Get Leagues by Team", + "description": "Retrieve all current and historical leagues for a team ID from Sportmonks" + }, + { + "name": "Football: Get Live Leagues", + "description": "Retrieve all leagues that have fixtures currently being played from Sportmonks" + }, + { + "name": "Football: Get Live Probabilities", + "description": "Retrieve all live (in-play) prediction probabilities from Sportmonks" + }, + { + "name": "Football: Get Live Probabilities by Fixture", + "description": "Retrieve all live (in-play) prediction probabilities for a fixture ID from Sportmonks" }, { - "name": "Get Football Player by ID", + "name": "Football: Get Live Standings by League", + "description": "Retrieve the live standing table for a league ID from Sportmonks" + }, + { + "name": "Football: Get Livescores", + "description": "Retrieve fixtures starting within 15 minutes and currently in progress from Sportmonks" + }, + { + "name": "Football: Get All Match Facts", + "description": "Retrieve all available match facts within your Sportmonks subscription (beta)" + }, + { + "name": "Football: Get Match Facts by Date Range", + "description": "Retrieve match facts within a date range (YYYY-MM-DD) from Sportmonks (beta)" + }, + { + "name": "Football: Get Match Facts by Fixture", + "description": "Retrieve match facts for a fixture ID from Sportmonks (beta)" + }, + { + "name": "Football: Get Match Facts by League", + "description": "Retrieve match facts for a league ID from Sportmonks (beta)" + }, + { + "name": "Football: Get Past Fixtures by TV Station", + "description": "Retrieve all past fixtures that were available for a TV station ID from Sportmonks" + }, + { + "name": "Football: Get Player by ID", "description": "Retrieve a single football player by their ID from Sportmonks" }, { - "name": "Get Football Standings by Season", + "name": "Football: Get Players by Country", + "description": "Retrieve all players for a country ID from Sportmonks" + }, + { + "name": "Football: Get Post-Match News", + "description": "Retrieve all post-match news articles available within your Sportmonks subscription" + }, + { + "name": "Football: Get Post-Match News by Season", + "description": "Retrieve all post-match news articles for a season ID from Sportmonks" + }, + { + "name": "Football: Get Predictability by League", + "description": "Retrieve the predictions model performance for a league ID from Sportmonks" + }, + { + "name": "Football: Get Pre-Match News", + "description": "Retrieve all pre-match news articles available within your Sportmonks subscription" + }, + { + "name": "Football: Get Pre-Match News by Season", + "description": "Retrieve all pre-match news articles for a season ID from Sportmonks" + }, + { + "name": "Football: Get Pre-Match News for Upcoming Fixtures", + "description": "Retrieve all pre-match news articles for upcoming fixtures from Sportmonks" + }, + { + "name": "Football: Get Probabilities", + "description": "Retrieve all prediction probabilities available within your Sportmonks subscription" + }, + { + "name": "Football: Get Predictions by Fixture", + "description": "Retrieve prediction probabilities for a fixture by fixture ID from Sportmonks" + }, + { + "name": "Football: Get Referee by ID", + "description": "Retrieve a single football referee by their ID from Sportmonks" + }, + { + "name": "Football: Get Referees", + "description": "Retrieve all football referees available within your Sportmonks subscription" + }, + { + "name": "Football: Get Referees by Country", + "description": "Retrieve all referees for a country ID from Sportmonks" + }, + { + "name": "Football: Get Referees by Season", + "description": "Retrieve all referees for a season ID from Sportmonks" + }, + { + "name": "Football: Get Rivals by Team", + "description": "Retrieve rival teams for a team by team ID from Sportmonks" + }, + { + "name": "Football: Get Round by ID", + "description": "Retrieve a single football round by its ID from Sportmonks" + }, + { + "name": "Football: Get Round Statistics", + "description": "Retrieve all available statistics for a round ID from Sportmonks" + }, + { + "name": "Football: Get Rounds", + "description": "Retrieve all football rounds available within your Sportmonks subscription" + }, + { + "name": "Football: Get Rounds by Season", + "description": "Retrieve all rounds for a season ID from Sportmonks" + }, + { + "name": "Football: Get Schedules by Season", + "description": "Retrieve the full schedule (stages, rounds and fixtures) for a season by season ID" + }, + { + "name": "Football: Get Schedules by Season and Team", + "description": "Retrieve the full season schedule for a specific team by season ID and team ID" + }, + { + "name": "Football: Get Schedules by Team", + "description": "Retrieve the full schedule (stages, rounds and fixtures) for a team by team ID" + }, + { + "name": "Football: Get Season by ID", + "description": "Retrieve a single football season by its ID from Sportmonks" + }, + { + "name": "Football: Get Seasons", + "description": "Retrieve all football seasons available within your Sportmonks subscription" + }, + { + "name": "Football: Get Seasons by Team", + "description": "Retrieve all seasons for a team ID from Sportmonks" + }, + { + "name": "Football: Get Stage by ID", + "description": "Retrieve a single football stage by its ID from Sportmonks" + }, + { + "name": "Football: Get Stage Statistics", + "description": "Retrieve all available statistics for a stage ID from Sportmonks" + }, + { + "name": "Football: Get Stages", + "description": "Retrieve all football stages available within your Sportmonks subscription" + }, + { + "name": "Football: Get Stages by Season", + "description": "Retrieve all stages for a season ID from Sportmonks" + }, + { + "name": "Football: Get Standing Corrections by Season", + "description": "Retrieve point corrections (awarded or deducted) for a season ID from Sportmonks" + }, + { + "name": "Football: Get All Standings", + "description": "Retrieve all standings available within your Sportmonks subscription" + }, + { + "name": "Football: Get Standings by Round", + "description": "Retrieve the full standing table for a round ID from Sportmonks" + }, + { + "name": "Football: Get Standings by Season", "description": "Retrieve the full league standings table for a season by season ID from Sportmonks" }, { - "name": "Get Football Topscorers by Season", + "name": "Football: Get State by ID", + "description": "Retrieve a single fixture state by its ID from Sportmonks" + }, + { + "name": "Football: Get States", + "description": "Retrieve all fixture states (e.g. Not Started, 1st Half, Full Time) from Sportmonks" + }, + { + "name": "Football: Get Team by ID", + "description": "Retrieve a single football team by its ID from Sportmonks" + }, + { + "name": "Football: Get All Team Rankings", + "description": "Retrieve all team rankings available within your Sportmonks subscription (beta)" + }, + { + "name": "Football: Get Team Rankings by Date", + "description": "Retrieve team rankings for a given date (YYYY-MM-DD) from Sportmonks (beta)" + }, + { + "name": "Football: Get Team Rankings by Team", + "description": "Retrieve team rankings for a team ID from Sportmonks (beta)" + }, + { + "name": "Football: Get Team Squad", + "description": "Retrieve the current domestic squad for a team by team ID from Sportmonks" + }, + { + "name": "Football: Get Team Squad by Season", + "description": "Retrieve the (historical) squad for a team in a specific season from Sportmonks" + }, + { + "name": "Football: Get Teams by Country", + "description": "Retrieve all teams for a country ID from Sportmonks" + }, + { + "name": "Football: Get Teams by Season", + "description": "Retrieve all teams for a season ID from Sportmonks" + }, + { + "name": "Football: Get Topscorers by Season", "description": "Retrieve the topscorers (goals, assists, cards) for a season by season ID from Sportmonks" }, { - "name": "Get Live Motorsport Scores", - "description": "Retrieve all live motorsport fixtures (sessions) from Sportmonks" + "name": "Football: Get Topscorers by Stage", + "description": "Retrieve topscorers for a stage by stage ID from Sportmonks" }, { - "name": "Get Motorsport Fixtures by Date", - "description": "Retrieve motorsport fixtures (sessions) on a specific date (YYYY-MM-DD) from Sportmonks" + "name": "Football: Get All Team of the Week", + "description": "Retrieve all available Team of the Week (TOTW) entries from Sportmonks" }, { - "name": "Get Motorsport Fixture by ID", - "description": "Retrieve a single motorsport fixture (session) by its ID from Sportmonks" + "name": "Football: Get Team of the Week by Round", + "description": "Retrieve the Team of the Week (TOTW) for a round ID from Sportmonks" }, { - "name": "Get Motorsport Drivers", - "description": "Retrieve all motorsport drivers from Sportmonks" + "name": "Football: Get Transfer by ID", + "description": "Retrieve a single transfer by its ID from Sportmonks" }, { - "name": "Get Motorsport Driver by ID", - "description": "Retrieve a single motorsport driver by their ID from Sportmonks" + "name": "Football: Get Transfer Rumour by ID", + "description": "Retrieve a single transfer rumour by its ID from Sportmonks" }, { - "name": "Search Motorsport Drivers", - "description": "Search for motorsport drivers by name from Sportmonks" + "name": "Football: Get Transfer Rumours Between Dates", + "description": "Retrieve transfer rumours within a date range (YYYY-MM-DD) from Sportmonks" }, { - "name": "Get Motorsport Teams", - "description": "Retrieve all motorsport teams (constructors) from Sportmonks" + "name": "Football: Get Transfer Rumours by Player", + "description": "Retrieve transfer rumours for a player ID from Sportmonks" }, { - "name": "Get Motorsport Team by ID", - "description": "Retrieve a single motorsport team (constructor) by its ID from Sportmonks" + "name": "Football: Get Transfer Rumours by Team", + "description": "Retrieve transfer rumours for a team ID from Sportmonks" + }, + { + "name": "Football: Get Transfers Between Dates", + "description": "Retrieve transfers within a date range (YYYY-MM-DD) from Sportmonks" + }, + { + "name": "Football: Get Transfers by Player", + "description": "Retrieve transfers for a player by player ID from Sportmonks" + }, + { + "name": "Football: Get Transfers by Team", + "description": "Retrieve transfers for a team by team ID from Sportmonks" + }, + { + "name": "Football: Get TV Station by ID", + "description": "Retrieve a single TV station by its ID from Sportmonks" + }, + { + "name": "Football: Get TV Stations", + "description": "Retrieve all TV stations available within your Sportmonks subscription" + }, + { + "name": "Football: Get TV Stations by Fixture", + "description": "Retrieve broadcasting TV stations for a fixture by fixture ID from Sportmonks" + }, + { + "name": "Football: Get Upcoming Fixtures by Market", + "description": "Retrieve all upcoming fixtures for a market ID from Sportmonks" + }, + { + "name": "Football: Get Upcoming Fixtures by TV Station", + "description": "Retrieve all upcoming fixtures available for a TV station ID from Sportmonks" + }, + { + "name": "Football: Get Value Bets", + "description": "Retrieve all value bets available within your Sportmonks subscription" + }, + { + "name": "Football: Get Value Bets by Fixture", + "description": "Retrieve value bet predictions for a fixture by fixture ID from Sportmonks" + }, + { + "name": "Football: Get Venue by ID", + "description": "Retrieve a single football venue by its ID from Sportmonks" + }, + { + "name": "Football: Get Venues", + "description": "Retrieve all football venues available within your Sportmonks subscription" + }, + { + "name": "Football: Get Venues by Season", + "description": "Retrieve all venues for a season ID from Sportmonks" + }, + { + "name": "Football: Search Coaches", + "description": "Search for football coaches by name from Sportmonks" + }, + { + "name": "Football: Search Fixtures", + "description": "Search for football fixtures by name (participants) from Sportmonks" + }, + { + "name": "Football: Search Leagues", + "description": "Search for football leagues by name from Sportmonks" + }, + { + "name": "Football: Search Players", + "description": "Search for football players by name from Sportmonks" + }, + { + "name": "Football: Search Referees", + "description": "Search for football referees by name from Sportmonks" + }, + { + "name": "Football: Search Rounds", + "description": "Search for football rounds by name from Sportmonks" + }, + { + "name": "Football: Search Seasons", + "description": "Search for football seasons by name from Sportmonks" + }, + { + "name": "Football: Search Stages", + "description": "Search for football stages by name from Sportmonks" + }, + { + "name": "Football: Search Teams", + "description": "Search for football teams by name from Sportmonks" + }, + { + "name": "Football: Search Venues", + "description": "Search for football venues by name from Sportmonks" + }, + { + "name": "Motorsport: Get All Fixtures", + "description": "Retrieve all motorsport fixtures (sessions) from Sportmonks" + }, + { + "name": "Motorsport: Get Current Leagues by Team", + "description": "Retrieve the current motorsport leagues for a team by team ID from Sportmonks" + }, + { + "name": "Motorsport: Get Driver by ID", + "description": "Retrieve a single motorsport driver by their ID from Sportmonks" }, { - "name": "Get Motorsport Driver Standings by Season", + "name": "Motorsport: Get All Driver Standings", + "description": "Retrieve all driver championship standings from Sportmonks" + }, + { + "name": "Motorsport: Get Driver Standings by Season", "description": "Retrieve the drivers championship standings for a season by season ID from Sportmonks" }, { - "name": "Get Motorsport Team Standings by Season", - "description": "Retrieve the constructors championship standings for a season by season ID from Sportmonks" + "name": "Motorsport: Get Drivers", + "description": "Retrieve all motorsport drivers from Sportmonks" }, { - "name": "Get Motorsport Laps by Fixture", + "name": "Motorsport: Get Drivers by Country", + "description": "Retrieve all motorsport drivers for a country by country ID from Sportmonks" + }, + { + "name": "Motorsport: Get Drivers by Season", + "description": "Retrieve all motorsport drivers for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Get Fixture by ID", + "description": "Retrieve a single motorsport fixture (session) by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get Fixtures by Date", + "description": "Retrieve motorsport fixtures (sessions) on a specific date (YYYY-MM-DD) from Sportmonks" + }, + { + "name": "Motorsport: Get Fixtures by Date Range", + "description": "Retrieve motorsport fixtures (sessions) between two dates (YYYY-MM-DD, max 100 days) from Sportmonks" + }, + { + "name": "Motorsport: Get Fixtures by IDs", + "description": "Retrieve multiple motorsport fixtures (sessions) by their IDs (max 50) from Sportmonks" + }, + { + "name": "Motorsport: Get Laps by Fixture", "description": "Retrieve all laps for a motorsport fixture (session) by fixture ID from Sportmonks" }, { - "name": "Get Motorsport Pitstops by Fixture", + "name": "Motorsport: Get Laps by Fixture and Driver", + "description": "Retrieve all laps for a motorsport fixture and driver from Sportmonks" + }, + { + "name": "Motorsport: Get Laps by Fixture and Lap Number", + "description": "Retrieve all laps for a motorsport fixture and lap number from Sportmonks" + }, + { + "name": "Motorsport: Get Latest Laps by Fixture", + "description": "Retrieve the latest laps for a motorsport fixture (session) by fixture ID from Sportmonks" + }, + { + "name": "Motorsport: Get Latest Pitstops by Fixture", + "description": "Retrieve the latest pitstops for a motorsport fixture (session) by fixture ID from Sportmonks" + }, + { + "name": "Motorsport: Get Latest Stints by Fixture", + "description": "Retrieve the latest tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks" + }, + { + "name": "Motorsport: Get Latest Updated Drivers", + "description": "Retrieve the most recently updated motorsport drivers from Sportmonks" + }, + { + "name": "Motorsport: Get Latest Updated Fixtures", + "description": "Retrieve the most recently updated motorsport fixtures (sessions) from Sportmonks" + }, + { + "name": "Motorsport: Get League by ID", + "description": "Retrieve a single motorsport league by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get All Leagues", + "description": "Retrieve all motorsport leagues from Sportmonks" + }, + { + "name": "Motorsport: Get Leagues by Country", + "description": "Retrieve all motorsport leagues for a country by country ID from Sportmonks" + }, + { + "name": "Motorsport: Get Leagues by Fixture Date", + "description": "Retrieve all motorsport leagues with fixtures on a specific date (YYYY-MM-DD) from Sportmonks" + }, + { + "name": "Motorsport: Get Leagues by Live", + "description": "Retrieve all motorsport leagues that currently have live fixtures from Sportmonks" + }, + { + "name": "Motorsport: Get Leagues by Team", + "description": "Retrieve all current and historical motorsport leagues for a team by team ID from Sportmonks" + }, + { + "name": "Motorsport: Get Livescores", + "description": "Retrieve all live motorsport fixtures (sessions) from Sportmonks" + }, + { + "name": "Motorsport: Get Pitstops by Fixture", "description": "Retrieve all pitstops for a motorsport fixture (session) by fixture ID from Sportmonks" }, { - "name": "Get Pre-match Odds by Fixture", - "description": "Retrieve pre-match odds for a fixture by fixture ID from the Sportmonks Odds API" + "name": "Motorsport: Get Pitstops by Fixture and Driver", + "description": "Retrieve all pitstops for a motorsport fixture and driver from Sportmonks" }, { - "name": "Get In-play Odds by Fixture", - "description": "Retrieve live (in-play) odds for a fixture by fixture ID from the Sportmonks Odds API" + "name": "Motorsport: Get Pitstops by Fixture and Lap Number", + "description": "Retrieve all pitstops for a motorsport fixture and lap number from Sportmonks" }, { - "name": "Get Bookmakers", - "description": "Retrieve all bookmakers from the Sportmonks Odds API" + "name": "Motorsport: Get Race Results by Season and Driver", + "description": "Retrieve race results (stages with fixtures, lineups and lineup details) for a season and driver from Sportmonks" }, { - "name": "Get Bookmaker by ID", + "name": "Motorsport: Get Race Results by Season and Team", + "description": "Retrieve race results (stages with fixtures, lineups and lineup details) for a season and team from Sportmonks" + }, + { + "name": "Motorsport: Get Schedules by Season", + "description": "Retrieve the full schedule (stages with nested fixtures and venues) for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Get Season by ID", + "description": "Retrieve a single motorsport season by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get All Seasons", + "description": "Retrieve all motorsport seasons from Sportmonks" + }, + { + "name": "Motorsport: Get Stage by ID", + "description": "Retrieve a single motorsport stage (race weekend) by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get All Stages", + "description": "Retrieve all motorsport stages (race weekends) from Sportmonks" + }, + { + "name": "Motorsport: Get Stages by Season", + "description": "Retrieve all motorsport stages (race weekends) for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Get State by ID", + "description": "Retrieve a single motorsport fixture state by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get All States", + "description": "Retrieve all possible motorsport fixture states from Sportmonks" + }, + { + "name": "Motorsport: Get Stints by Fixture", + "description": "Retrieve all tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks" + }, + { + "name": "Motorsport: Get Stints by Fixture and Driver", + "description": "Retrieve all tyre stints for a motorsport fixture and driver from Sportmonks" + }, + { + "name": "Motorsport: Get Stints by Fixture and Stint Number", + "description": "Retrieve all tyre stints for a motorsport fixture and stint number from Sportmonks" + }, + { + "name": "Motorsport: Get Team by ID", + "description": "Retrieve a single motorsport team (constructor) by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get All Team Standings", + "description": "Retrieve all team (constructor) championship standings from Sportmonks" + }, + { + "name": "Motorsport: Get Team Standings by Season", + "description": "Retrieve the constructors championship standings for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Get Teams", + "description": "Retrieve all motorsport teams (constructors) from Sportmonks" + }, + { + "name": "Motorsport: Get Teams by Country", + "description": "Retrieve all motorsport teams (constructors) for a country by country ID from Sportmonks" + }, + { + "name": "Motorsport: Get Teams by Season", + "description": "Retrieve all motorsport teams (constructors) for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Get Venue by ID", + "description": "Retrieve a single motorsport venue (racing track) by its ID from Sportmonks" + }, + { + "name": "Motorsport: Get Venues", + "description": "Retrieve all motorsport venues (racing tracks) from Sportmonks" + }, + { + "name": "Motorsport: Get Venues by Season", + "description": "Retrieve all motorsport venues (racing tracks) for a season by season ID from Sportmonks" + }, + { + "name": "Motorsport: Search Drivers", + "description": "Search for motorsport drivers by name from Sportmonks" + }, + { + "name": "Motorsport: Search Leagues", + "description": "Search for motorsport leagues by name from Sportmonks" + }, + { + "name": "Motorsport: Search Stages", + "description": "Search for motorsport stages (race weekends) by name from Sportmonks" + }, + { + "name": "Motorsport: Search Teams", + "description": "Search for motorsport teams (constructors) by name from Sportmonks" + }, + { + "name": "Motorsport: Search Venues", + "description": "Search for motorsport venues (racing tracks) by name from Sportmonks" + }, + { + "name": "Odds: Get All Historical Odds", + "description": "Retrieve all available historical (premium) pre-match odd values from the Sportmonks Odds API" + }, + { + "name": "Odds: Get All In-play Odds", + "description": "Retrieve all available live (in-play) odds from the Sportmonks Odds API" + }, + { + "name": "Odds: Get All Pre-match Odds", + "description": "Retrieve all available pre-match odds from the Sportmonks Odds API" + }, + { + "name": "Odds: Get All Premium Odds", + "description": "Retrieve all available premium (historical) pre-match odds from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Bookmaker by ID", "description": "Retrieve a single bookmaker by its ID from the Sportmonks Odds API" }, { - "name": "Search Bookmakers", - "description": "Search for bookmakers by name from the Sportmonks Odds API" + "name": "Odds: Get Bookmaker Event IDs by Fixture", + "description": "Retrieve bookmakers' own event ids mapped to a Sportmonks fixture via the Sportmonks Odds API" }, { - "name": "Get Betting Markets", - "description": "Retrieve all betting markets from the Sportmonks Odds API" + "name": "Odds: Get Bookmakers", + "description": "Retrieve all bookmakers from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Bookmakers by Fixture", + "description": "Retrieve all bookmakers available for a fixture from the Sportmonks Odds API" + }, + { + "name": "Odds: Get In-play Odds by Fixture", + "description": "Retrieve live (in-play) odds for a fixture by fixture ID from the Sportmonks Odds API" + }, + { + "name": "Odds: Get In-play Odds by Fixture and Bookmaker", + "description": "Retrieve live (in-play) odds for a fixture from a specific bookmaker via the Sportmonks Odds API" }, { - "name": "Get Betting Market by ID", + "name": "Odds: Get In-play Odds by Fixture and Market", + "description": "Retrieve live (in-play) odds for a fixture on a specific market via the Sportmonks Odds API" + }, + { + "name": "Odds: Get Last Updated In-play Odds", + "description": "Retrieve in-play odds updated in the last 10 seconds from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Last Updated Pre-match Odds", + "description": "Retrieve pre-match odds updated in the last 10 seconds from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Market by ID", "description": "Retrieve a single betting market by its ID from the Sportmonks Odds API" }, { - "name": "Search Betting Markets", + "name": "Odds: Get Markets", + "description": "Retrieve all betting markets from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Pre-match Odds by Fixture", + "description": "Retrieve pre-match odds for a fixture by fixture ID from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Pre-match Odds by Fixture and Bookmaker", + "description": "Retrieve pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API" + }, + { + "name": "Odds: Get Pre-match Odds by Fixture and Market", + "description": "Retrieve pre-match odds for a fixture on a specific market via the Sportmonks Odds API" + }, + { + "name": "Odds: Get Premium Odds by Fixture", + "description": "Retrieve premium (historical) pre-match odds for a fixture from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Premium Odds by Fixture and Bookmaker", + "description": "Retrieve premium pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API" + }, + { + "name": "Odds: Get Premium Odds by Fixture and Market", + "description": "Retrieve premium pre-match odds for a fixture on a specific market via the Sportmonks Odds API" + }, + { + "name": "Odds: Get Updated Historical Odds Between Time Range", + "description": "Retrieve historical (premium) odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API" + }, + { + "name": "Odds: Get Updated Premium Odds Between Time Range", + "description": "Retrieve premium odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API" + }, + { + "name": "Odds: Search Bookmakers", + "description": "Search for bookmakers by name from the Sportmonks Odds API" + }, + { + "name": "Odds: Search Markets", "description": "Search for betting markets by name from the Sportmonks Odds API" }, { - "name": "Get Continents", - "description": "Retrieve all continents from the Sportmonks Core API" + "name": "Core: Get Cities", + "description": "Retrieve all cities from the Sportmonks Core API" }, { - "name": "Get Continent by ID", + "name": "Core: Get City by ID", + "description": "Retrieve a single city by its ID from the Sportmonks Core API" + }, + { + "name": "Core: Get Continent by ID", "description": "Retrieve a single continent by its ID from the Sportmonks Core API" }, { - "name": "Get Countries", + "name": "Core: Get Continents", + "description": "Retrieve all continents from the Sportmonks Core API" + }, + { + "name": "Core: Get Countries", "description": "Retrieve all countries from the Sportmonks Core API" }, { - "name": "Get Country by ID", + "name": "Core: Get Country by ID", "description": "Retrieve a single country by its ID from the Sportmonks Core API" }, { - "name": "Search Countries", - "description": "Search for countries by name from the Sportmonks Core API" + "name": "Core: Get All Entity Filters", + "description": "Retrieve all available filters grouped per entity from the Sportmonks Core API" }, { - "name": "Get Regions", - "description": "Retrieve all regions from the Sportmonks Core API" + "name": "Core: Get My Usage", + "description": "Retrieve your Sportmonks API usage aggregated per 5 minutes" }, { - "name": "Get Region by ID", + "name": "Core: Get Region by ID", "description": "Retrieve a single region by its ID from the Sportmonks Core API" }, { - "name": "Get Cities", - "description": "Retrieve all cities from the Sportmonks Core API" + "name": "Core: Get Regions", + "description": "Retrieve all regions from the Sportmonks Core API" }, { - "name": "Get City by ID", - "description": "Retrieve a single city by its ID from the Sportmonks Core API" + "name": "Core: Get Timezones", + "description": "Retrieve all supported time zones (IANA names) from the Sportmonks Core API" }, { - "name": "Search Cities", - "description": "Search for cities by name from the Sportmonks Core API" + "name": "Core: Get Type by ID", + "description": "Retrieve a single type by its ID from the Sportmonks Core API" + }, + { + "name": "Core: Get Type by Entity", + "description": "Retrieve the available types grouped per entity from the Sportmonks Core API" }, { - "name": "Get Types", + "name": "Core: Get Types", "description": "Retrieve all types (reference data describing events, statistics, positions, etc.) from the Sportmonks Core API" }, { - "name": "Get Type by ID", - "description": "Retrieve a single type by its ID from the Sportmonks Core API" + "name": "Core: Search Cities", + "description": "Search for cities by name from the Sportmonks Core API" }, { - "name": "Get Timezones", - "description": "Retrieve all supported time zones (IANA names) from the Sportmonks Core API" + "name": "Core: Search Countries", + "description": "Search for countries by name from the Sportmonks Core API" + }, + { + "name": "Core: Search Regions", + "description": "Search for regions by name from the Sportmonks Core API" } ], - "operationCount": 48, + "operationCount": 221, "triggers": [], "triggerCount": 0, "authType": "api-key", diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index 43d9eb05cb3..3c40cdf7b5c 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -3109,52 +3109,225 @@ import { sportmonksCoreGetContinentTool, sportmonksCoreGetCountriesTool, sportmonksCoreGetCountryTool, + sportmonksCoreGetEntityFiltersTool, + sportmonksCoreGetMyUsageTool, sportmonksCoreGetRegionsTool, sportmonksCoreGetRegionTool, sportmonksCoreGetTimezonesTool, + sportmonksCoreGetTypeByEntityTool, sportmonksCoreGetTypesTool, sportmonksCoreGetTypeTool, sportmonksCoreSearchCitiesTool, sportmonksCoreSearchCountriesTool, + sportmonksCoreSearchRegionsTool, } from '@/tools/sportmonks_core' import { + sportmonksExpectedByPlayerTool, + sportmonksExpectedByTeamTool, + sportmonksGetAllCommentariesTool, + sportmonksGetAllFixturesTool, + sportmonksGetAllPlayersTool, + sportmonksGetAllRivalsTool, + sportmonksGetAllTeamsTool, + sportmonksGetAllTransferRumoursTool, + sportmonksGetAllTransfersTool, + sportmonksGetBracketsBySeasonTool, + sportmonksGetCoachesByCountryTool, + sportmonksGetCoachesTool, + sportmonksGetCoachTool, + sportmonksGetCommentariesByFixtureTool, + sportmonksGetCurrentLeaguesByTeamTool, + sportmonksGetExpectedLineupsByPlayerTool, + sportmonksGetExpectedLineupsByTeamTool, + sportmonksGetExtendedTeamSquadTool, + sportmonksGetFixturesByDateRangeForTeamTool, sportmonksGetFixturesByDateRangeTool, sportmonksGetFixturesByDateTool, + sportmonksGetFixturesByIdsTool, sportmonksGetFixtureTool, + sportmonksGetGroupedStandingsByRoundTool, sportmonksGetHeadToHeadTool, sportmonksGetInplayLivescoresTool, + sportmonksGetLatestCoachesTool, + sportmonksGetLatestFixturesTool, + sportmonksGetLatestLivescoresTool, + sportmonksGetLatestPlayersTool, + sportmonksGetLatestTotwTool, + sportmonksGetLatestTransfersTool, + sportmonksGetLeaguesByCountryTool, + sportmonksGetLeaguesByDateTool, + sportmonksGetLeaguesByTeamTool, sportmonksGetLeaguesTool, sportmonksGetLeagueTool, + sportmonksGetLiveLeaguesTool, + sportmonksGetLiveProbabilitiesByFixtureTool, + sportmonksGetLiveProbabilitiesTool, + sportmonksGetLiveStandingsByLeagueTool, sportmonksGetLivescoresTool, + sportmonksGetMatchFactsByDateRangeTool, + sportmonksGetMatchFactsByFixtureTool, + sportmonksGetMatchFactsByLeagueTool, + sportmonksGetMatchFactsTool, + sportmonksGetPastFixturesByTvStationTool, + sportmonksGetPlayersByCountryTool, sportmonksGetPlayerTool, + sportmonksGetPostmatchNewsBySeasonTool, + sportmonksGetPostmatchNewsTool, + sportmonksGetPredictabilityByLeagueTool, + sportmonksGetPrematchNewsBySeasonTool, + sportmonksGetPrematchNewsTool, + sportmonksGetPrematchNewsUpcomingTool, + sportmonksGetProbabilitiesByFixtureTool, + sportmonksGetProbabilitiesTool, + sportmonksGetRefereesByCountryTool, + sportmonksGetRefereesBySeasonTool, + sportmonksGetRefereesTool, + sportmonksGetRefereeTool, + sportmonksGetRivalsByTeamTool, + sportmonksGetRoundStatisticsTool, + sportmonksGetRoundsBySeasonTool, + sportmonksGetRoundsTool, + sportmonksGetRoundTool, + sportmonksGetSchedulesBySeasonAndTeamTool, + sportmonksGetSchedulesBySeasonTool, + sportmonksGetSchedulesByTeamTool, + sportmonksGetSeasonsByTeamTool, + sportmonksGetSeasonsTool, + sportmonksGetSeasonTool, + sportmonksGetStageStatisticsTool, + sportmonksGetStagesBySeasonTool, + sportmonksGetStagesTool, + sportmonksGetStageTool, + sportmonksGetStandingCorrectionsBySeasonTool, + sportmonksGetStandingsByRoundTool, sportmonksGetStandingsBySeasonTool, + sportmonksGetStandingsTool, + sportmonksGetStatesTool, + sportmonksGetStateTool, + sportmonksGetTeamRankingsByDateTool, + sportmonksGetTeamRankingsByTeamTool, + sportmonksGetTeamRankingsTool, + sportmonksGetTeamSquadBySeasonTool, sportmonksGetTeamSquadTool, + sportmonksGetTeamsByCountryTool, + sportmonksGetTeamsBySeasonTool, sportmonksGetTeamTool, sportmonksGetTopscorersBySeasonTool, + sportmonksGetTopscorersByStageTool, + sportmonksGetTotwByRoundTool, + sportmonksGetTotwTool, + sportmonksGetTransferRumoursBetweenDatesTool, + sportmonksGetTransferRumoursByPlayerTool, + sportmonksGetTransferRumoursByTeamTool, + sportmonksGetTransferRumourTool, + sportmonksGetTransfersBetweenDatesTool, + sportmonksGetTransfersByPlayerTool, + sportmonksGetTransfersByTeamTool, + sportmonksGetTransferTool, + sportmonksGetTvStationsByFixtureTool, + sportmonksGetTvStationsTool, + sportmonksGetTvStationTool, + sportmonksGetUpcomingFixturesByMarketTool, + sportmonksGetUpcomingFixturesByTvStationTool, + sportmonksGetValueBetsByFixtureTool, + sportmonksGetValueBetsTool, + sportmonksGetVenuesBySeasonTool, + sportmonksGetVenuesTool, + sportmonksGetVenueTool, + sportmonksSearchCoachesTool, + sportmonksSearchFixturesTool, + sportmonksSearchLeaguesTool, sportmonksSearchPlayersTool, + sportmonksSearchRefereesTool, + sportmonksSearchRoundsTool, + sportmonksSearchSeasonsTool, + sportmonksSearchStagesTool, sportmonksSearchTeamsTool, + sportmonksSearchVenuesTool, } from '@/tools/sportmonks_football' import { + sportmonksMotorsportGetAllFixturesTool, + sportmonksMotorsportGetCurrentLeaguesByTeamTool, sportmonksMotorsportGetDriverStandingsBySeasonTool, + sportmonksMotorsportGetDriverStandingsTool, + sportmonksMotorsportGetDriversByCountryTool, + sportmonksMotorsportGetDriversBySeasonTool, sportmonksMotorsportGetDriversTool, sportmonksMotorsportGetDriverTool, + sportmonksMotorsportGetFixturesByDateRangeTool, sportmonksMotorsportGetFixturesByDateTool, + sportmonksMotorsportGetFixturesByIdsTool, sportmonksMotorsportGetFixtureTool, + sportmonksMotorsportGetLapsByFixtureAndDriverTool, + sportmonksMotorsportGetLapsByFixtureAndLapTool, sportmonksMotorsportGetLapsByFixtureTool, + sportmonksMotorsportGetLatestLapsByFixtureTool, + sportmonksMotorsportGetLatestPitstopsByFixtureTool, + sportmonksMotorsportGetLatestStintsByFixtureTool, + sportmonksMotorsportGetLatestUpdatedDriversTool, + sportmonksMotorsportGetLatestUpdatedFixturesTool, + sportmonksMotorsportGetLeaguesByCountryTool, + sportmonksMotorsportGetLeaguesByDateTool, + sportmonksMotorsportGetLeaguesByLiveTool, + sportmonksMotorsportGetLeaguesByTeamTool, + sportmonksMotorsportGetLeaguesTool, + sportmonksMotorsportGetLeagueTool, sportmonksMotorsportGetLivescoresTool, + sportmonksMotorsportGetPitstopsByFixtureAndDriverTool, + sportmonksMotorsportGetPitstopsByFixtureAndLapTool, sportmonksMotorsportGetPitstopsByFixtureTool, + sportmonksMotorsportGetRaceResultsBySeasonAndDriverTool, + sportmonksMotorsportGetRaceResultsBySeasonAndTeamTool, + sportmonksMotorsportGetSchedulesBySeasonTool, + sportmonksMotorsportGetSeasonsTool, + sportmonksMotorsportGetSeasonTool, + sportmonksMotorsportGetStagesBySeasonTool, + sportmonksMotorsportGetStagesTool, + sportmonksMotorsportGetStageTool, + sportmonksMotorsportGetStatesTool, + sportmonksMotorsportGetStateTool, + sportmonksMotorsportGetStintsByFixtureAndDriverTool, + sportmonksMotorsportGetStintsByFixtureAndStintTool, + sportmonksMotorsportGetStintsByFixtureTool, sportmonksMotorsportGetTeamStandingsBySeasonTool, + sportmonksMotorsportGetTeamStandingsTool, + sportmonksMotorsportGetTeamsByCountryTool, + sportmonksMotorsportGetTeamsBySeasonTool, sportmonksMotorsportGetTeamsTool, sportmonksMotorsportGetTeamTool, + sportmonksMotorsportGetVenuesBySeasonTool, + sportmonksMotorsportGetVenuesTool, + sportmonksMotorsportGetVenueTool, sportmonksMotorsportSearchDriversTool, + sportmonksMotorsportSearchLeaguesTool, + sportmonksMotorsportSearchStagesTool, + sportmonksMotorsportSearchTeamsTool, + sportmonksMotorsportSearchVenuesTool, } from '@/tools/sportmonks_motorsport' import { + sportmonksOddsGetAllHistoricalOddsTool, + sportmonksOddsGetAllInplayOddsTool, + sportmonksOddsGetAllPreMatchOddsTool, + sportmonksOddsGetAllPremiumOddsTool, + sportmonksOddsGetBookmakerEventIdsByFixtureTool, + sportmonksOddsGetBookmakersByFixtureTool, sportmonksOddsGetBookmakersTool, sportmonksOddsGetBookmakerTool, + sportmonksOddsGetInplayOddsByFixtureAndBookmakerTool, + sportmonksOddsGetInplayOddsByFixtureAndMarketTool, sportmonksOddsGetInplayOddsByFixtureTool, + sportmonksOddsGetLastUpdatedInplayOddsTool, + sportmonksOddsGetLastUpdatedPreMatchOddsTool, sportmonksOddsGetMarketsTool, sportmonksOddsGetMarketTool, + sportmonksOddsGetPreMatchOddsByFixtureAndBookmakerTool, + sportmonksOddsGetPreMatchOddsByFixtureAndMarketTool, sportmonksOddsGetPreMatchOddsByFixtureTool, + sportmonksOddsGetPremiumOddsByFixtureAndBookmakerTool, + sportmonksOddsGetPremiumOddsByFixtureAndMarketTool, + sportmonksOddsGetPremiumOddsByFixtureTool, + sportmonksOddsGetUpdatedHistoricalOddsBetweenTool, + sportmonksOddsGetUpdatedPremiumOddsBetweenTool, sportmonksOddsSearchBookmakersTool, sportmonksOddsSearchMarketsTool, } from '@/tools/sportmonks_odds' @@ -4255,56 +4428,253 @@ export const tools: Record = { sendgrid_delete_template: sendGridDeleteTemplateTool, sendgrid_create_template_version: sendGridCreateTemplateVersionTool, smtp_send_mail: smtpSendMailTool, + sportmonks_football_expected_by_player: sportmonksExpectedByPlayerTool, + sportmonks_football_expected_by_team: sportmonksExpectedByTeamTool, + sportmonks_football_get_all_commentaries: sportmonksGetAllCommentariesTool, + sportmonks_football_get_all_fixtures: sportmonksGetAllFixturesTool, + sportmonks_football_get_all_players: sportmonksGetAllPlayersTool, + sportmonks_football_get_all_rivals: sportmonksGetAllRivalsTool, + sportmonks_football_get_all_teams: sportmonksGetAllTeamsTool, + sportmonks_football_get_all_transfer_rumours: sportmonksGetAllTransferRumoursTool, + sportmonks_football_get_all_transfers: sportmonksGetAllTransfersTool, + sportmonks_football_get_brackets_by_season: sportmonksGetBracketsBySeasonTool, + sportmonks_football_get_coach: sportmonksGetCoachTool, + sportmonks_football_get_coaches: sportmonksGetCoachesTool, + sportmonks_football_get_coaches_by_country: sportmonksGetCoachesByCountryTool, + sportmonks_football_get_commentaries_by_fixture: sportmonksGetCommentariesByFixtureTool, + sportmonks_football_get_current_leagues_by_team: sportmonksGetCurrentLeaguesByTeamTool, + sportmonks_football_get_expected_lineups_by_player: sportmonksGetExpectedLineupsByPlayerTool, + sportmonks_football_get_expected_lineups_by_team: sportmonksGetExpectedLineupsByTeamTool, + sportmonks_football_get_extended_team_squad: sportmonksGetExtendedTeamSquadTool, + sportmonks_football_get_fixture: sportmonksGetFixtureTool, sportmonks_football_get_fixtures_by_date: sportmonksGetFixturesByDateTool, sportmonks_football_get_fixtures_by_date_range: sportmonksGetFixturesByDateRangeTool, - sportmonks_football_get_fixture: sportmonksGetFixtureTool, + sportmonks_football_get_fixtures_by_date_range_for_team: + sportmonksGetFixturesByDateRangeForTeamTool, + sportmonks_football_get_fixtures_by_ids: sportmonksGetFixturesByIdsTool, + sportmonks_football_get_grouped_standings_by_round: sportmonksGetGroupedStandingsByRoundTool, sportmonks_football_get_head_to_head: sportmonksGetHeadToHeadTool, - sportmonks_football_get_livescores: sportmonksGetLivescoresTool, sportmonks_football_get_inplay_livescores: sportmonksGetInplayLivescoresTool, - sportmonks_football_get_leagues: sportmonksGetLeaguesTool, + sportmonks_football_get_latest_coaches: sportmonksGetLatestCoachesTool, + sportmonks_football_get_latest_fixtures: sportmonksGetLatestFixturesTool, + sportmonks_football_get_latest_livescores: sportmonksGetLatestLivescoresTool, + sportmonks_football_get_latest_players: sportmonksGetLatestPlayersTool, + sportmonks_football_get_latest_totw: sportmonksGetLatestTotwTool, + sportmonks_football_get_latest_transfers: sportmonksGetLatestTransfersTool, sportmonks_football_get_league: sportmonksGetLeagueTool, - sportmonks_football_search_teams: sportmonksSearchTeamsTool, - sportmonks_football_get_team: sportmonksGetTeamTool, - sportmonks_football_get_team_squad: sportmonksGetTeamSquadTool, - sportmonks_football_search_players: sportmonksSearchPlayersTool, + sportmonks_football_get_leagues: sportmonksGetLeaguesTool, + sportmonks_football_get_leagues_by_country: sportmonksGetLeaguesByCountryTool, + sportmonks_football_get_leagues_by_date: sportmonksGetLeaguesByDateTool, + sportmonks_football_get_leagues_by_team: sportmonksGetLeaguesByTeamTool, + sportmonks_football_get_live_leagues: sportmonksGetLiveLeaguesTool, + sportmonks_football_get_live_probabilities: sportmonksGetLiveProbabilitiesTool, + sportmonks_football_get_live_probabilities_by_fixture: + sportmonksGetLiveProbabilitiesByFixtureTool, + sportmonks_football_get_live_standings_by_league: sportmonksGetLiveStandingsByLeagueTool, + sportmonks_football_get_livescores: sportmonksGetLivescoresTool, + sportmonks_football_get_match_facts: sportmonksGetMatchFactsTool, + sportmonks_football_get_match_facts_by_date_range: sportmonksGetMatchFactsByDateRangeTool, + sportmonks_football_get_match_facts_by_fixture: sportmonksGetMatchFactsByFixtureTool, + sportmonks_football_get_match_facts_by_league: sportmonksGetMatchFactsByLeagueTool, + sportmonks_football_get_past_fixtures_by_tv_station: sportmonksGetPastFixturesByTvStationTool, sportmonks_football_get_player: sportmonksGetPlayerTool, + sportmonks_football_get_players_by_country: sportmonksGetPlayersByCountryTool, + sportmonks_football_get_postmatch_news: sportmonksGetPostmatchNewsTool, + sportmonks_football_get_postmatch_news_by_season: sportmonksGetPostmatchNewsBySeasonTool, + sportmonks_football_get_predictability_by_league: sportmonksGetPredictabilityByLeagueTool, + sportmonks_football_get_prematch_news: sportmonksGetPrematchNewsTool, + sportmonks_football_get_prematch_news_by_season: sportmonksGetPrematchNewsBySeasonTool, + sportmonks_football_get_prematch_news_upcoming: sportmonksGetPrematchNewsUpcomingTool, + sportmonks_football_get_probabilities: sportmonksGetProbabilitiesTool, + sportmonks_football_get_probabilities_by_fixture: sportmonksGetProbabilitiesByFixtureTool, + sportmonks_football_get_referee: sportmonksGetRefereeTool, + sportmonks_football_get_referees: sportmonksGetRefereesTool, + sportmonks_football_get_referees_by_country: sportmonksGetRefereesByCountryTool, + sportmonks_football_get_referees_by_season: sportmonksGetRefereesBySeasonTool, + sportmonks_football_get_rivals_by_team: sportmonksGetRivalsByTeamTool, + sportmonks_football_get_round: sportmonksGetRoundTool, + sportmonks_football_get_round_statistics: sportmonksGetRoundStatisticsTool, + sportmonks_football_get_rounds: sportmonksGetRoundsTool, + sportmonks_football_get_rounds_by_season: sportmonksGetRoundsBySeasonTool, + sportmonks_football_get_schedules_by_season: sportmonksGetSchedulesBySeasonTool, + sportmonks_football_get_schedules_by_season_and_team: sportmonksGetSchedulesBySeasonAndTeamTool, + sportmonks_football_get_schedules_by_team: sportmonksGetSchedulesByTeamTool, + sportmonks_football_get_season: sportmonksGetSeasonTool, + sportmonks_football_get_seasons: sportmonksGetSeasonsTool, + sportmonks_football_get_seasons_by_team: sportmonksGetSeasonsByTeamTool, + sportmonks_football_get_stage: sportmonksGetStageTool, + sportmonks_football_get_stage_statistics: sportmonksGetStageStatisticsTool, + sportmonks_football_get_stages: sportmonksGetStagesTool, + sportmonks_football_get_stages_by_season: sportmonksGetStagesBySeasonTool, + sportmonks_football_get_standing_corrections_by_season: + sportmonksGetStandingCorrectionsBySeasonTool, + sportmonks_football_get_standings: sportmonksGetStandingsTool, + sportmonks_football_get_standings_by_round: sportmonksGetStandingsByRoundTool, sportmonks_football_get_standings_by_season: sportmonksGetStandingsBySeasonTool, + sportmonks_football_get_state: sportmonksGetStateTool, + sportmonks_football_get_states: sportmonksGetStatesTool, + sportmonks_football_get_team: sportmonksGetTeamTool, + sportmonks_football_get_team_rankings: sportmonksGetTeamRankingsTool, + sportmonks_football_get_team_rankings_by_date: sportmonksGetTeamRankingsByDateTool, + sportmonks_football_get_team_rankings_by_team: sportmonksGetTeamRankingsByTeamTool, + sportmonks_football_get_team_squad: sportmonksGetTeamSquadTool, + sportmonks_football_get_team_squad_by_season: sportmonksGetTeamSquadBySeasonTool, + sportmonks_football_get_teams_by_country: sportmonksGetTeamsByCountryTool, + sportmonks_football_get_teams_by_season: sportmonksGetTeamsBySeasonTool, sportmonks_football_get_topscorers_by_season: sportmonksGetTopscorersBySeasonTool, - sportmonks_core_get_continents: sportmonksCoreGetContinentsTool, - sportmonks_core_get_continent: sportmonksCoreGetContinentTool, - sportmonks_core_get_countries: sportmonksCoreGetCountriesTool, - sportmonks_core_get_country: sportmonksCoreGetCountryTool, - sportmonks_core_search_countries: sportmonksCoreSearchCountriesTool, - sportmonks_core_get_regions: sportmonksCoreGetRegionsTool, - sportmonks_core_get_region: sportmonksCoreGetRegionTool, - sportmonks_core_get_cities: sportmonksCoreGetCitiesTool, - sportmonks_core_get_city: sportmonksCoreGetCityTool, - sportmonks_core_search_cities: sportmonksCoreSearchCitiesTool, - sportmonks_core_get_types: sportmonksCoreGetTypesTool, - sportmonks_core_get_type: sportmonksCoreGetTypeTool, - sportmonks_core_get_timezones: sportmonksCoreGetTimezonesTool, - sportmonks_motorsport_get_livescores: sportmonksMotorsportGetLivescoresTool, - sportmonks_motorsport_get_fixtures_by_date: sportmonksMotorsportGetFixturesByDateTool, - sportmonks_motorsport_get_fixture: sportmonksMotorsportGetFixtureTool, - sportmonks_motorsport_get_drivers: sportmonksMotorsportGetDriversTool, + sportmonks_football_get_topscorers_by_stage: sportmonksGetTopscorersByStageTool, + sportmonks_football_get_totw: sportmonksGetTotwTool, + sportmonks_football_get_totw_by_round: sportmonksGetTotwByRoundTool, + sportmonks_football_get_transfer: sportmonksGetTransferTool, + sportmonks_football_get_transfer_rumour: sportmonksGetTransferRumourTool, + sportmonks_football_get_transfer_rumours_between_dates: + sportmonksGetTransferRumoursBetweenDatesTool, + sportmonks_football_get_transfer_rumours_by_player: sportmonksGetTransferRumoursByPlayerTool, + sportmonks_football_get_transfer_rumours_by_team: sportmonksGetTransferRumoursByTeamTool, + sportmonks_football_get_transfers_between_dates: sportmonksGetTransfersBetweenDatesTool, + sportmonks_football_get_transfers_by_player: sportmonksGetTransfersByPlayerTool, + sportmonks_football_get_transfers_by_team: sportmonksGetTransfersByTeamTool, + sportmonks_football_get_tv_station: sportmonksGetTvStationTool, + sportmonks_football_get_tv_stations: sportmonksGetTvStationsTool, + sportmonks_football_get_tv_stations_by_fixture: sportmonksGetTvStationsByFixtureTool, + sportmonks_football_get_upcoming_fixtures_by_market: sportmonksGetUpcomingFixturesByMarketTool, + sportmonks_football_get_upcoming_fixtures_by_tv_station: + sportmonksGetUpcomingFixturesByTvStationTool, + sportmonks_football_get_value_bets: sportmonksGetValueBetsTool, + sportmonks_football_get_value_bets_by_fixture: sportmonksGetValueBetsByFixtureTool, + sportmonks_football_get_venue: sportmonksGetVenueTool, + sportmonks_football_get_venues: sportmonksGetVenuesTool, + sportmonks_football_get_venues_by_season: sportmonksGetVenuesBySeasonTool, + sportmonks_football_search_coaches: sportmonksSearchCoachesTool, + sportmonks_football_search_fixtures: sportmonksSearchFixturesTool, + sportmonks_football_search_leagues: sportmonksSearchLeaguesTool, + sportmonks_football_search_players: sportmonksSearchPlayersTool, + sportmonks_football_search_referees: sportmonksSearchRefereesTool, + sportmonks_football_search_rounds: sportmonksSearchRoundsTool, + sportmonks_football_search_seasons: sportmonksSearchSeasonsTool, + sportmonks_football_search_stages: sportmonksSearchStagesTool, + sportmonks_football_search_teams: sportmonksSearchTeamsTool, + sportmonks_football_search_venues: sportmonksSearchVenuesTool, + sportmonks_motorsport_get_all_fixtures: sportmonksMotorsportGetAllFixturesTool, + sportmonks_motorsport_get_current_leagues_by_team: + sportmonksMotorsportGetCurrentLeaguesByTeamTool, sportmonks_motorsport_get_driver: sportmonksMotorsportGetDriverTool, - sportmonks_motorsport_search_drivers: sportmonksMotorsportSearchDriversTool, - sportmonks_motorsport_get_teams: sportmonksMotorsportGetTeamsTool, - sportmonks_motorsport_get_team: sportmonksMotorsportGetTeamTool, + sportmonks_motorsport_get_driver_standings: sportmonksMotorsportGetDriverStandingsTool, sportmonks_motorsport_get_driver_standings_by_season: sportmonksMotorsportGetDriverStandingsBySeasonTool, - sportmonks_motorsport_get_team_standings_by_season: - sportmonksMotorsportGetTeamStandingsBySeasonTool, + sportmonks_motorsport_get_drivers: sportmonksMotorsportGetDriversTool, + sportmonks_motorsport_get_drivers_by_country: sportmonksMotorsportGetDriversByCountryTool, + sportmonks_motorsport_get_drivers_by_season: sportmonksMotorsportGetDriversBySeasonTool, + sportmonks_motorsport_get_fixture: sportmonksMotorsportGetFixtureTool, + sportmonks_motorsport_get_fixtures_by_date: sportmonksMotorsportGetFixturesByDateTool, + sportmonks_motorsport_get_fixtures_by_date_range: sportmonksMotorsportGetFixturesByDateRangeTool, + sportmonks_motorsport_get_fixtures_by_ids: sportmonksMotorsportGetFixturesByIdsTool, sportmonks_motorsport_get_laps_by_fixture: sportmonksMotorsportGetLapsByFixtureTool, + sportmonks_motorsport_get_laps_by_fixture_and_driver: + sportmonksMotorsportGetLapsByFixtureAndDriverTool, + sportmonks_motorsport_get_laps_by_fixture_and_lap: sportmonksMotorsportGetLapsByFixtureAndLapTool, + sportmonks_motorsport_get_latest_laps_by_fixture: sportmonksMotorsportGetLatestLapsByFixtureTool, + sportmonks_motorsport_get_latest_pitstops_by_fixture: + sportmonksMotorsportGetLatestPitstopsByFixtureTool, + sportmonks_motorsport_get_latest_stints_by_fixture: + sportmonksMotorsportGetLatestStintsByFixtureTool, + sportmonks_motorsport_get_latest_updated_drivers: sportmonksMotorsportGetLatestUpdatedDriversTool, + sportmonks_motorsport_get_latest_updated_fixtures: + sportmonksMotorsportGetLatestUpdatedFixturesTool, + sportmonks_motorsport_get_league: sportmonksMotorsportGetLeagueTool, + sportmonks_motorsport_get_leagues: sportmonksMotorsportGetLeaguesTool, + sportmonks_motorsport_get_leagues_by_country: sportmonksMotorsportGetLeaguesByCountryTool, + sportmonks_motorsport_get_leagues_by_date: sportmonksMotorsportGetLeaguesByDateTool, + sportmonks_motorsport_get_leagues_by_live: sportmonksMotorsportGetLeaguesByLiveTool, + sportmonks_motorsport_get_leagues_by_team: sportmonksMotorsportGetLeaguesByTeamTool, + sportmonks_motorsport_get_livescores: sportmonksMotorsportGetLivescoresTool, sportmonks_motorsport_get_pitstops_by_fixture: sportmonksMotorsportGetPitstopsByFixtureTool, - sportmonks_odds_get_pre_match_odds_by_fixture: sportmonksOddsGetPreMatchOddsByFixtureTool, - sportmonks_odds_get_inplay_odds_by_fixture: sportmonksOddsGetInplayOddsByFixtureTool, - sportmonks_odds_get_bookmakers: sportmonksOddsGetBookmakersTool, + sportmonks_motorsport_get_pitstops_by_fixture_and_driver: + sportmonksMotorsportGetPitstopsByFixtureAndDriverTool, + sportmonks_motorsport_get_pitstops_by_fixture_and_lap: + sportmonksMotorsportGetPitstopsByFixtureAndLapTool, + sportmonks_motorsport_get_race_results_by_season_and_driver: + sportmonksMotorsportGetRaceResultsBySeasonAndDriverTool, + sportmonks_motorsport_get_race_results_by_season_and_team: + sportmonksMotorsportGetRaceResultsBySeasonAndTeamTool, + sportmonks_motorsport_get_schedules_by_season: sportmonksMotorsportGetSchedulesBySeasonTool, + sportmonks_motorsport_get_season: sportmonksMotorsportGetSeasonTool, + sportmonks_motorsport_get_seasons: sportmonksMotorsportGetSeasonsTool, + sportmonks_motorsport_get_stage: sportmonksMotorsportGetStageTool, + sportmonks_motorsport_get_stages: sportmonksMotorsportGetStagesTool, + sportmonks_motorsport_get_stages_by_season: sportmonksMotorsportGetStagesBySeasonTool, + sportmonks_motorsport_get_state: sportmonksMotorsportGetStateTool, + sportmonks_motorsport_get_states: sportmonksMotorsportGetStatesTool, + sportmonks_motorsport_get_stints_by_fixture: sportmonksMotorsportGetStintsByFixtureTool, + sportmonks_motorsport_get_stints_by_fixture_and_driver: + sportmonksMotorsportGetStintsByFixtureAndDriverTool, + sportmonks_motorsport_get_stints_by_fixture_and_stint: + sportmonksMotorsportGetStintsByFixtureAndStintTool, + sportmonks_motorsport_get_team: sportmonksMotorsportGetTeamTool, + sportmonks_motorsport_get_team_standings: sportmonksMotorsportGetTeamStandingsTool, + sportmonks_motorsport_get_team_standings_by_season: + sportmonksMotorsportGetTeamStandingsBySeasonTool, + sportmonks_motorsport_get_teams: sportmonksMotorsportGetTeamsTool, + sportmonks_motorsport_get_teams_by_country: sportmonksMotorsportGetTeamsByCountryTool, + sportmonks_motorsport_get_teams_by_season: sportmonksMotorsportGetTeamsBySeasonTool, + sportmonks_motorsport_get_venue: sportmonksMotorsportGetVenueTool, + sportmonks_motorsport_get_venues: sportmonksMotorsportGetVenuesTool, + sportmonks_motorsport_get_venues_by_season: sportmonksMotorsportGetVenuesBySeasonTool, + sportmonks_motorsport_search_drivers: sportmonksMotorsportSearchDriversTool, + sportmonks_motorsport_search_leagues: sportmonksMotorsportSearchLeaguesTool, + sportmonks_motorsport_search_stages: sportmonksMotorsportSearchStagesTool, + sportmonks_motorsport_search_teams: sportmonksMotorsportSearchTeamsTool, + sportmonks_motorsport_search_venues: sportmonksMotorsportSearchVenuesTool, + sportmonks_odds_get_all_historical_odds: sportmonksOddsGetAllHistoricalOddsTool, + sportmonks_odds_get_all_inplay_odds: sportmonksOddsGetAllInplayOddsTool, + sportmonks_odds_get_all_pre_match_odds: sportmonksOddsGetAllPreMatchOddsTool, + sportmonks_odds_get_all_premium_odds: sportmonksOddsGetAllPremiumOddsTool, sportmonks_odds_get_bookmaker: sportmonksOddsGetBookmakerTool, - sportmonks_odds_search_bookmakers: sportmonksOddsSearchBookmakersTool, - sportmonks_odds_get_markets: sportmonksOddsGetMarketsTool, + sportmonks_odds_get_bookmaker_event_ids_by_fixture: + sportmonksOddsGetBookmakerEventIdsByFixtureTool, + sportmonks_odds_get_bookmakers: sportmonksOddsGetBookmakersTool, + sportmonks_odds_get_bookmakers_by_fixture: sportmonksOddsGetBookmakersByFixtureTool, + sportmonks_odds_get_inplay_odds_by_fixture: sportmonksOddsGetInplayOddsByFixtureTool, + sportmonks_odds_get_inplay_odds_by_fixture_and_bookmaker: + sportmonksOddsGetInplayOddsByFixtureAndBookmakerTool, + sportmonks_odds_get_inplay_odds_by_fixture_and_market: + sportmonksOddsGetInplayOddsByFixtureAndMarketTool, + sportmonks_odds_get_last_updated_inplay_odds: sportmonksOddsGetLastUpdatedInplayOddsTool, + sportmonks_odds_get_last_updated_pre_match_odds: sportmonksOddsGetLastUpdatedPreMatchOddsTool, sportmonks_odds_get_market: sportmonksOddsGetMarketTool, + sportmonks_odds_get_markets: sportmonksOddsGetMarketsTool, + sportmonks_odds_get_pre_match_odds_by_fixture: sportmonksOddsGetPreMatchOddsByFixtureTool, + sportmonks_odds_get_pre_match_odds_by_fixture_and_bookmaker: + sportmonksOddsGetPreMatchOddsByFixtureAndBookmakerTool, + sportmonks_odds_get_pre_match_odds_by_fixture_and_market: + sportmonksOddsGetPreMatchOddsByFixtureAndMarketTool, + sportmonks_odds_get_premium_odds_by_fixture: sportmonksOddsGetPremiumOddsByFixtureTool, + sportmonks_odds_get_premium_odds_by_fixture_and_bookmaker: + sportmonksOddsGetPremiumOddsByFixtureAndBookmakerTool, + sportmonks_odds_get_premium_odds_by_fixture_and_market: + sportmonksOddsGetPremiumOddsByFixtureAndMarketTool, + sportmonks_odds_get_updated_historical_odds_between: + sportmonksOddsGetUpdatedHistoricalOddsBetweenTool, + sportmonks_odds_get_updated_premium_odds_between: sportmonksOddsGetUpdatedPremiumOddsBetweenTool, + sportmonks_odds_search_bookmakers: sportmonksOddsSearchBookmakersTool, sportmonks_odds_search_markets: sportmonksOddsSearchMarketsTool, + sportmonks_core_get_cities: sportmonksCoreGetCitiesTool, + sportmonks_core_get_city: sportmonksCoreGetCityTool, + sportmonks_core_get_continent: sportmonksCoreGetContinentTool, + sportmonks_core_get_continents: sportmonksCoreGetContinentsTool, + sportmonks_core_get_countries: sportmonksCoreGetCountriesTool, + sportmonks_core_get_country: sportmonksCoreGetCountryTool, + sportmonks_core_get_entity_filters: sportmonksCoreGetEntityFiltersTool, + sportmonks_core_get_my_usage: sportmonksCoreGetMyUsageTool, + sportmonks_core_get_region: sportmonksCoreGetRegionTool, + sportmonks_core_get_regions: sportmonksCoreGetRegionsTool, + sportmonks_core_get_timezones: sportmonksCoreGetTimezonesTool, + sportmonks_core_get_type: sportmonksCoreGetTypeTool, + sportmonks_core_get_type_by_entity: sportmonksCoreGetTypeByEntityTool, + sportmonks_core_get_types: sportmonksCoreGetTypesTool, + sportmonks_core_search_cities: sportmonksCoreSearchCitiesTool, + sportmonks_core_search_countries: sportmonksCoreSearchCountriesTool, + sportmonks_core_search_regions: sportmonksCoreSearchRegionsTool, sftp_upload: sftpUploadTool, sftp_download: sftpDownloadTool, sftp_list: sftpListTool, diff --git a/apps/sim/tools/sportmonks_core/get_continents.ts b/apps/sim/tools/sportmonks_core/get_continents.ts index 54c39b29452..bc0c2a59ca4 100644 --- a/apps/sim/tools/sportmonks_core/get_continents.ts +++ b/apps/sim/tools/sportmonks_core/get_continents.ts @@ -47,12 +47,6 @@ export const sportmonksCoreGetContinentsTool: ToolConfig< visibility: 'user-or-llm', description: 'Semicolon-separated relations to enrich the response (e.g. countries)', }, - filters: { - type: 'string', - required: false, - visibility: 'user-or-llm', - description: 'Filters to apply', - }, per_page: { type: 'string', required: false, diff --git a/apps/sim/tools/sportmonks_core/get_entity_filters.ts b/apps/sim/tools/sportmonks_core/get_entity_filters.ts new file mode 100644 index 00000000000..66b5791bc78 --- /dev/null +++ b/apps/sim/tools/sportmonks_core/get_entity_filters.ts @@ -0,0 +1,61 @@ +import { + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_MY_BASE_URL, type SportmonksEntityFilters } from '@/tools/sportmonks_core/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetEntityFiltersParams extends SportmonksBaseParams {} + +export interface SportmonksGetEntityFiltersResponse extends ToolResponse { + output: { + entityFilters: SportmonksEntityFilters | null + } +} + +export const sportmonksCoreGetEntityFiltersTool: ToolConfig< + SportmonksGetEntityFiltersParams, + SportmonksGetEntityFiltersResponse +> = { + id: 'sportmonks_core_get_entity_filters', + name: 'Get All Entity Filters', + description: 'Retrieve all available filters grouped per entity from the Sportmonks Core API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + }, + + request: { + url: () => `${SPORTMONKS_MY_BASE_URL}/filters/entity`, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_entity_filters') + } + return { + success: true, + output: { + entityFilters: data.data ?? null, + }, + } + }, + + outputs: { + entityFilters: { + type: 'json', + description: + 'Map of entity name to its available filter names, e.g. {fixture: ["fixtureLeagues", "fixtureSeasons"], event: ["eventTypes"]}', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_core/get_my_usage.ts b/apps/sim/tools/sportmonks_core/get_my_usage.ts new file mode 100644 index 00000000000..fc776e34371 --- /dev/null +++ b/apps/sim/tools/sportmonks_core/get_my_usage.ts @@ -0,0 +1,92 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MY_BASE_URL, + SPORTMONKS_USAGE_PROPERTIES, + type SportmonksUsage, +} from '@/tools/sportmonks_core/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetMyUsageParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetMyUsageResponse extends ToolResponse { + output: { + usage: SportmonksUsage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksCoreGetMyUsageTool: ToolConfig< + SportmonksGetMyUsageParams, + SportmonksGetMyUsageResponse +> = { + id: 'sportmonks_core_get_my_usage', + name: 'Get My Usage', + description: 'Retrieve your Sportmonks API usage aggregated per 5 minutes', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MY_BASE_URL}/usage`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_my_usage') + } + return { + success: true, + output: { + usage: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + usage: { + type: 'array', + description: 'Array of API usage records aggregated per 5-minute period', + items: { type: 'object', properties: SPORTMONKS_USAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_core/get_type_by_entity.ts b/apps/sim/tools/sportmonks_core/get_type_by_entity.ts new file mode 100644 index 00000000000..58f882ab5b4 --- /dev/null +++ b/apps/sim/tools/sportmonks_core/get_type_by_entity.ts @@ -0,0 +1,64 @@ +import { + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_CORE_BASE_URL, + type SportmonksTypesByEntity, +} from '@/tools/sportmonks_core/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTypeByEntityParams extends SportmonksBaseParams {} + +export interface SportmonksGetTypeByEntityResponse extends ToolResponse { + output: { + typesByEntity: SportmonksTypesByEntity | null + } +} + +export const sportmonksCoreGetTypeByEntityTool: ToolConfig< + SportmonksGetTypeByEntityParams, + SportmonksGetTypeByEntityResponse +> = { + id: 'sportmonks_core_get_type_by_entity', + name: 'Get Type by Entity', + description: 'Retrieve the available types grouped per entity from the Sportmonks Core API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + }, + + request: { + url: () => `${SPORTMONKS_CORE_BASE_URL}/types/entities`, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_type_by_entity') + } + return { + success: true, + output: { + typesByEntity: data.data ?? null, + }, + } + }, + + outputs: { + typesByEntity: { + type: 'json', + description: + 'Map of entity name to its available types, e.g. {CoachStatisticDetail: {updated_at, types: [{id, name, code, developer_name, model_type, stat_group}]}}', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_core/index.ts b/apps/sim/tools/sportmonks_core/index.ts index 1074d060463..04bd83ac30b 100644 --- a/apps/sim/tools/sportmonks_core/index.ts +++ b/apps/sim/tools/sportmonks_core/index.ts @@ -4,10 +4,14 @@ export { sportmonksCoreGetContinentTool } from './get_continent' export { sportmonksCoreGetContinentsTool } from './get_continents' export { sportmonksCoreGetCountriesTool } from './get_countries' export { sportmonksCoreGetCountryTool } from './get_country' +export { sportmonksCoreGetEntityFiltersTool } from './get_entity_filters' +export { sportmonksCoreGetMyUsageTool } from './get_my_usage' export { sportmonksCoreGetRegionTool } from './get_region' export { sportmonksCoreGetRegionsTool } from './get_regions' export { sportmonksCoreGetTimezonesTool } from './get_timezones' export { sportmonksCoreGetTypeTool } from './get_type' +export { sportmonksCoreGetTypeByEntityTool } from './get_type_by_entity' export { sportmonksCoreGetTypesTool } from './get_types' export { sportmonksCoreSearchCitiesTool } from './search_cities' export { sportmonksCoreSearchCountriesTool } from './search_countries' +export { sportmonksCoreSearchRegionsTool } from './search_regions' diff --git a/apps/sim/tools/sportmonks_core/search_cities.ts b/apps/sim/tools/sportmonks_core/search_cities.ts index 91d463a5c41..ecbef83ae53 100644 --- a/apps/sim/tools/sportmonks_core/search_cities.ts +++ b/apps/sim/tools/sportmonks_core/search_cities.ts @@ -55,6 +55,12 @@ export const sportmonksCoreSearchCitiesTool: ToolConfig< visibility: 'user-or-llm', description: 'Semicolon-separated relations to enrich the response (e.g. region)', }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, per_page: { type: 'string', required: false, @@ -67,6 +73,12 @@ export const sportmonksCoreSearchCitiesTool: ToolConfig< visibility: 'user-or-llm', description: 'Page number to retrieve', }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, }, request: { diff --git a/apps/sim/tools/sportmonks_core/search_countries.ts b/apps/sim/tools/sportmonks_core/search_countries.ts index cf3fc3101b4..6545c068eed 100644 --- a/apps/sim/tools/sportmonks_core/search_countries.ts +++ b/apps/sim/tools/sportmonks_core/search_countries.ts @@ -53,7 +53,13 @@ export const sportmonksCoreSearchCountriesTool: ToolConfig< type: 'string', required: false, visibility: 'user-or-llm', - description: 'Semicolon-separated relations to enrich the response (e.g. continent)', + description: 'Semicolon-separated relations to enrich the response (e.g. continent;regions)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', }, per_page: { type: 'string', @@ -67,6 +73,12 @@ export const sportmonksCoreSearchCountriesTool: ToolConfig< visibility: 'user-or-llm', description: 'Page number to retrieve', }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, }, request: { diff --git a/apps/sim/tools/sportmonks_core/search_regions.ts b/apps/sim/tools/sportmonks_core/search_regions.ts new file mode 100644 index 00000000000..7ff009da784 --- /dev/null +++ b/apps/sim/tools/sportmonks_core/search_regions.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_CORE_BASE_URL, + SPORTMONKS_REGION_PROPERTIES, + type SportmonksRegion, +} from '@/tools/sportmonks_core/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchRegionsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchRegionsResponse extends ToolResponse { + output: { + regions: SportmonksRegion[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksCoreSearchRegionsTool: ToolConfig< + SportmonksSearchRegionsParams, + SportmonksSearchRegionsResponse +> = { + id: 'sportmonks_core_search_regions', + name: 'Search Regions', + description: 'Search for regions by name from the Sportmonks Core API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The region name to search for (e.g. Utrecht)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;cities)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_CORE_BASE_URL}/regions/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_regions') + } + return { + success: true, + output: { + regions: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + regions: { + type: 'array', + description: 'Array of region objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_REGION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_core/types.ts b/apps/sim/tools/sportmonks_core/types.ts index 08dd316f083..2852a80d8ea 100644 --- a/apps/sim/tools/sportmonks_core/types.ts +++ b/apps/sim/tools/sportmonks_core/types.ts @@ -6,6 +6,14 @@ import type { OutputProperty } from '@/tools/types' */ export const SPORTMONKS_CORE_BASE_URL = 'https://api.sportmonks.com/v3/core' +/** + * Base URL for the Sportmonks "My Sportmonks" endpoints (account/subscription + * scoped data such as entity filters and API usage). These live under `/v3/my` + * rather than `/v3/core` but are documented as part of the Core API. + * @see https://docs.sportmonks.com/v3/core-api/my-sportmonks/get-my-usage + */ +export const SPORTMONKS_MY_BASE_URL = 'https://api.sportmonks.com/v3/my' + /** * Output property definitions for a Continent object. * @see https://docs.sportmonks.com/v3/core-api/entities/core @@ -78,7 +86,12 @@ export const SPORTMONKS_REGION_PROPERTIES = { export const SPORTMONKS_CITY_PROPERTIES = { id: { type: 'number', description: 'Unique id of the city' }, country_id: { type: 'number', description: 'Country of the city' }, - region: { type: 'number', description: 'Region of the city', nullable: true, optional: true }, + region_id: { + type: 'number', + description: 'Region id of the city', + nullable: true, + optional: true, + }, name: { type: 'string', description: 'Name of the city' }, latitude: { type: 'string', description: 'Latitude of the city', nullable: true, optional: true }, longitude: { @@ -124,6 +137,29 @@ export const SPORTMONKS_TYPE_PROPERTIES = { }, } as const satisfies Record +/** + * Output property definitions for a My Sportmonks API usage record. + * @see https://docs.sportmonks.com/v3/core-api/my-sportmonks/get-my-usage + */ +export const SPORTMONKS_USAGE_PROPERTIES = { + id: { type: 'number', description: 'Identifier of the usage record' }, + endpoint: { type: 'string', description: 'Identifier of the requested endpoint' }, + count: { type: 'number', description: 'Total calls for the given timeframe' }, + entity: { type: 'string', description: 'The entity the rate limit applies on' }, + remaining_requests: { + type: 'number', + description: 'Amount of requests remaining for the entity in the hourly rate limit', + }, + period_start: { + type: 'number', + description: 'Timestamp representing the aggregation start time', + }, + period_end: { + type: 'number', + description: 'Timestamp representing the aggregation end time', + }, +} as const satisfies Record + export interface SportmonksContinent { id: number name: string @@ -154,7 +190,7 @@ export interface SportmonksRegion { export interface SportmonksCity { id: number country_id: number - region?: number | null + region_id?: number | null name: string latitude?: string | null longitude?: string | null @@ -170,3 +206,41 @@ export interface SportmonksType { group?: string | null description?: string | null } + +export interface SportmonksUsage { + id: number + endpoint: string + count: number + entity: string + remaining_requests: number + period_start: number + period_end: number +} + +/** A single type entry as returned by the "Type by Entity" endpoint. */ +export interface SportmonksTypeEntityEntry { + id: number + name: string + code?: string | null + developer_name?: string | null + model_type?: string | null + stat_group?: string | null +} + +/** The per-entity grouping returned by the "Type by Entity" endpoint. */ +export interface SportmonksTypeEntityGroup { + updated_at: string + types: SportmonksTypeEntityEntry[] +} + +/** + * Response shape of the "Type by Entity" endpoint: a map keyed by entity name + * (e.g. CoachStatisticDetail) to its available types. + */ +export type SportmonksTypesByEntity = Record + +/** + * Response shape of the "All Entity Filters" endpoint: a map keyed by entity + * name to the list of filter names available on that entity. + */ +export type SportmonksEntityFilters = Record diff --git a/apps/sim/tools/sportmonks_football/expected_by_player.ts b/apps/sim/tools/sportmonks_football/expected_by_player.ts new file mode 100644 index 00000000000..d09b3d61ad1 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/expected_by_player.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_EXPECTED_PLAYER_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksExpectedPlayer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksExpectedByPlayerParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksExpectedByPlayerResponse extends ToolResponse { + output: { + expected: SportmonksExpectedPlayer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksExpectedByPlayerTool: ToolConfig< + SportmonksExpectedByPlayerParams, + SportmonksExpectedByPlayerResponse +> = { + id: 'sportmonks_football_expected_by_player', + name: 'Get Expected xG by Player', + description: 'Retrieve lineup-level expected goals (xG) values per player from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fixture;player;team;type)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/expected/lineups`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'expected_by_player') + } + return { + success: true, + output: { + expected: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + expected: { + type: 'array', + description: 'Array of player-level expected goals (xG) entries', + items: { type: 'object', properties: SPORTMONKS_EXPECTED_PLAYER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/expected_by_team.ts b/apps/sim/tools/sportmonks_football/expected_by_team.ts new file mode 100644 index 00000000000..772c9b5a37d --- /dev/null +++ b/apps/sim/tools/sportmonks_football/expected_by_team.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_EXPECTED_TEAM_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksExpectedTeam, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksExpectedByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksExpectedByTeamResponse extends ToolResponse { + output: { + expected: SportmonksExpectedTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksExpectedByTeamTool: ToolConfig< + SportmonksExpectedByTeamParams, + SportmonksExpectedByTeamResponse +> = { + id: 'sportmonks_football_expected_by_team', + name: 'Get Expected xG by Team', + description: 'Retrieve fixture-level expected goals (xG) values per team from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fixture;participant;type)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/expected/fixtures`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'expected_by_team') + } + return { + success: true, + output: { + expected: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + expected: { + type: 'array', + description: 'Array of team-level expected goals (xG) entries', + items: { type: 'object', properties: SPORTMONKS_EXPECTED_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_commentaries.ts b/apps/sim/tools/sportmonks_football/get_all_commentaries.ts new file mode 100644 index 00000000000..ecd5c4436ce --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_commentaries.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COMMENTARY_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCommentary, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllCommentariesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllCommentariesResponse extends ToolResponse { + output: { + commentaries: SportmonksCommentary[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllCommentariesTool: ToolConfig< + SportmonksGetAllCommentariesParams, + SportmonksGetAllCommentariesResponse +> = { + id: 'sportmonks_football_get_all_commentaries', + name: 'Get All Commentaries', + description: 'Retrieve all textual commentaries available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;player)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/commentaries`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_commentaries') + } + return { + success: true, + output: { + commentaries: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + commentaries: { + type: 'array', + description: 'Array of commentary entries', + items: { type: 'object', properties: SPORTMONKS_COMMENTARY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_fixtures.ts b/apps/sim/tools/sportmonks_football/get_all_fixtures.ts new file mode 100644 index 00000000000..0a21b7fdcd5 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_fixtures.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllFixturesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllFixturesResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllFixturesTool: ToolConfig< + SportmonksGetAllFixturesParams, + SportmonksGetAllFixturesResponse +> = { + id: 'sportmonks_football_get_all_fixtures', + name: 'Get All Fixtures', + description: 'Retrieve all football fixtures available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_fixtures') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of fixture objects', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_players.ts b/apps/sim/tools/sportmonks_football/get_all_players.ts new file mode 100644 index 00000000000..98c96f0bcd0 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_players.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PLAYER_PROPERTIES, + type SportmonksPlayer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllPlayersParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllPlayersResponse extends ToolResponse { + output: { + players: SportmonksPlayer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllPlayersTool: ToolConfig< + SportmonksGetAllPlayersParams, + SportmonksGetAllPlayersResponse +> = { + id: 'sportmonks_football_get_all_players', + name: 'Get All Players', + description: 'Retrieve all football players available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. nationality;position)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order players by id (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/players`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_players') + } + return { + success: true, + output: { + players: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + players: { + type: 'array', + description: 'Array of player objects', + items: { type: 'object', properties: SPORTMONKS_PLAYER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_rivals.ts b/apps/sim/tools/sportmonks_football/get_all_rivals.ts new file mode 100644 index 00000000000..1837819aa31 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_rivals.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_RIVAL_PROPERTIES, + type SportmonksRival, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllRivalsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllRivalsResponse extends ToolResponse { + output: { + rivals: SportmonksRival[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllRivalsTool: ToolConfig< + SportmonksGetAllRivalsParams, + SportmonksGetAllRivalsResponse +> = { + id: 'sportmonks_football_get_all_rivals', + name: 'Get All Rivals', + description: 'Retrieve all teams with their rivals information from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. team;rival)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/rivals`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_rivals') + } + return { + success: true, + output: { + rivals: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + rivals: { + type: 'array', + description: 'Array of rival relationships', + items: { type: 'object', properties: SPORTMONKS_RIVAL_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_teams.ts b/apps/sim/tools/sportmonks_football/get_all_teams.ts new file mode 100644 index 00000000000..815b90f4980 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_teams.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_PROPERTIES, + type SportmonksTeam, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllTeamsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllTeamsResponse extends ToolResponse { + output: { + teams: SportmonksTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllTeamsTool: ToolConfig< + SportmonksGetAllTeamsParams, + SportmonksGetAllTeamsResponse +> = { + id: 'sportmonks_football_get_all_teams', + name: 'Get All Teams', + description: 'Retrieve all football teams available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;venue)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order teams by id (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/teams`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_teams') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team objects', + items: { type: 'object', properties: SPORTMONKS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_transfer_rumours.ts b/apps/sim/tools/sportmonks_football/get_all_transfer_rumours.ts new file mode 100644 index 00000000000..295d86a2483 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_transfer_rumours.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + type SportmonksTransferRumour, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllTransferRumoursParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllTransferRumoursResponse extends ToolResponse { + output: { + transferRumours: SportmonksTransferRumour[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllTransferRumoursTool: ToolConfig< + SportmonksGetAllTransferRumoursParams, + SportmonksGetAllTransferRumoursResponse +> = { + id: 'sportmonks_football_get_all_transfer_rumours', + name: 'Get All Transfer Rumours', + description: 'Retrieve all transfer rumours available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/transfer-rumours`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_transfer_rumours') + } + return { + success: true, + output: { + transferRumours: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transferRumours: { + type: 'array', + description: 'Array of transfer rumour objects', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_all_transfers.ts b/apps/sim/tools/sportmonks_football/get_all_transfers.ts new file mode 100644 index 00000000000..755290efe95 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_all_transfers.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllTransfersParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllTransfersResponse extends ToolResponse { + output: { + transfers: SportmonksTransfer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetAllTransfersTool: ToolConfig< + SportmonksGetAllTransfersParams, + SportmonksGetAllTransfersResponse +> = { + id: 'sportmonks_football_get_all_transfers', + name: 'Get All Transfers', + description: 'Retrieve all transfers available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. transferTypes:219,220)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/transfers`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_transfers') + } + return { + success: true, + output: { + transfers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transfers: { + type: 'array', + description: 'Array of transfer objects', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_brackets_by_season.ts b/apps/sim/tools/sportmonks_football/get_brackets_by_season.ts new file mode 100644 index 00000000000..fda5f32582d --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_brackets_by_season.ts @@ -0,0 +1,80 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_FOOTBALL_BASE_URL } from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetBracketsBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetBracketsBySeasonResponse extends ToolResponse { + output: { + brackets: Record | null + } +} + +export const sportmonksGetBracketsBySeasonTool: ToolConfig< + SportmonksGetBracketsBySeasonParams, + SportmonksGetBracketsBySeasonResponse +> = { + id: 'sportmonks_football_get_brackets_by_season', + name: 'Get Brackets by Season', + description: + 'Retrieve the knockout-stage tournament bracket (stages and progression edges) for a season ID', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/seasons/${encodeURIComponent(params.seasonId.trim())}/brackets` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_brackets_by_season') + } + return { + success: true, + output: { + brackets: data.data ?? null, + }, + } + }, + + outputs: { + brackets: { + type: 'json', + description: + 'Bracket object containing stages (fixtures grouped by knockout round) and edges (progression paths between fixtures)', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_coach.ts b/apps/sim/tools/sportmonks_football/get_coach.ts new file mode 100644 index 00000000000..d1c1d1a149e --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_coach.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COACH_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCoach, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetCoachParams extends SportmonksBaseParams { + coachId: string +} + +export interface SportmonksGetCoachResponse extends ToolResponse { + output: { + coach: SportmonksCoach | null + } +} + +export const sportmonksGetCoachTool: ToolConfig< + SportmonksGetCoachParams, + SportmonksGetCoachResponse +> = { + id: 'sportmonks_football_get_coach', + name: 'Get Coach by ID', + description: 'Retrieve a single football coach by their ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + coachId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the coach', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;teams;statistics)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/coaches/${encodeURIComponent(params.coachId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_coach') + } + return { + success: true, + output: { + coach: data.data ?? null, + }, + } + }, + + outputs: { + coach: { + type: 'object', + description: 'The requested coach object', + properties: SPORTMONKS_COACH_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_coaches.ts b/apps/sim/tools/sportmonks_football/get_coaches.ts new file mode 100644 index 00000000000..d4c8f04394a --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_coaches.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COACH_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCoach, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetCoachesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetCoachesResponse extends ToolResponse { + output: { + coaches: SportmonksCoach[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetCoachesTool: ToolConfig< + SportmonksGetCoachesParams, + SportmonksGetCoachesResponse +> = { + id: 'sportmonks_football_get_coaches', + name: 'Get Coaches', + description: 'Retrieve all football coaches available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. coachCountries:462)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/coaches`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_coaches') + } + return { + success: true, + output: { + coaches: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + coaches: { + type: 'array', + description: 'Array of coach objects', + items: { type: 'object', properties: SPORTMONKS_COACH_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_coaches_by_country.ts b/apps/sim/tools/sportmonks_football/get_coaches_by_country.ts new file mode 100644 index 00000000000..9fd95925921 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_coaches_by_country.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COACH_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCoach, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetCoachesByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksGetCoachesByCountryResponse extends ToolResponse { + output: { + coaches: SportmonksCoach[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetCoachesByCountryTool: ToolConfig< + SportmonksGetCoachesByCountryParams, + SportmonksGetCoachesByCountryResponse +> = { + id: 'sportmonks_football_get_coaches_by_country', + name: 'Get Coaches by Country', + description: 'Retrieve all coaches for a country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;nationality)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/coaches/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_coaches_by_country') + } + return { + success: true, + output: { + coaches: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + coaches: { + type: 'array', + description: 'Array of coach objects for the country', + items: { type: 'object', properties: SPORTMONKS_COACH_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_commentaries_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_commentaries_by_fixture.ts new file mode 100644 index 00000000000..bdff8a5a290 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_commentaries_by_fixture.ts @@ -0,0 +1,84 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COMMENTARY_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCommentary, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetCommentariesByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksGetCommentariesByFixtureResponse extends ToolResponse { + output: { + commentaries: SportmonksCommentary[] + } +} + +export const sportmonksGetCommentariesByFixtureTool: ToolConfig< + SportmonksGetCommentariesByFixtureParams, + SportmonksGetCommentariesByFixtureResponse +> = { + id: 'sportmonks_football_get_commentaries_by_fixture', + name: 'Get Commentaries by Fixture', + description: 'Retrieve textual commentary for a fixture by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;relatedPlayer)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/commentaries/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_commentaries_by_fixture') + } + return { + success: true, + output: { + commentaries: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + commentaries: { + type: 'array', + description: 'Array of commentary entries for the fixture', + items: { type: 'object', properties: SPORTMONKS_COMMENTARY_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_current_leagues_by_team.ts b/apps/sim/tools/sportmonks_football/get_current_leagues_by_team.ts new file mode 100644 index 00000000000..cab3406d2da --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_current_leagues_by_team.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetCurrentLeaguesByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetCurrentLeaguesByTeamResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetCurrentLeaguesByTeamTool: ToolConfig< + SportmonksGetCurrentLeaguesByTeamParams, + SportmonksGetCurrentLeaguesByTeamResponse +> = { + id: 'sportmonks_football_get_current_leagues_by_team', + name: 'Get Current Leagues by Team', + description: 'Retrieve all current leagues for a team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/teams/${encodeURIComponent(params.teamId.trim())}/current` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_current_leagues_by_team') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of current league objects for the team', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_expected_lineups_by_player.ts b/apps/sim/tools/sportmonks_football/get_expected_lineups_by_player.ts new file mode 100644 index 00000000000..5257ed1e53e --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_expected_lineups_by_player.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_EXPECTED_LINEUP_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksExpectedLineup, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetExpectedLineupsByPlayerParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + playerId: string +} + +export interface SportmonksGetExpectedLineupsByPlayerResponse extends ToolResponse { + output: { + expectedLineups: SportmonksExpectedLineup[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetExpectedLineupsByPlayerTool: ToolConfig< + SportmonksGetExpectedLineupsByPlayerParams, + SportmonksGetExpectedLineupsByPlayerResponse +> = { + id: 'sportmonks_football_get_expected_lineups_by_player', + name: 'Get Expected Lineups by Player', + description: 'Retrieve the premium expected lineups for a player ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + playerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the player', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. player;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/expected-lineups/players/${encodeURIComponent(params.playerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_expected_lineups_by_player') + } + return { + success: true, + output: { + expectedLineups: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + expectedLineups: { + type: 'array', + description: 'Array of expected lineup entries for the player', + items: { type: 'object', properties: SPORTMONKS_EXPECTED_LINEUP_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_expected_lineups_by_team.ts b/apps/sim/tools/sportmonks_football/get_expected_lineups_by_team.ts new file mode 100644 index 00000000000..40442052990 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_expected_lineups_by_team.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_EXPECTED_LINEUP_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksExpectedLineup, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetExpectedLineupsByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetExpectedLineupsByTeamResponse extends ToolResponse { + output: { + expectedLineups: SportmonksExpectedLineup[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetExpectedLineupsByTeamTool: ToolConfig< + SportmonksGetExpectedLineupsByTeamParams, + SportmonksGetExpectedLineupsByTeamResponse +> = { + id: 'sportmonks_football_get_expected_lineups_by_team', + name: 'Get Expected Lineups by Team', + description: 'Retrieve the premium expected lineups for a team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. player;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/expected-lineups/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_expected_lineups_by_team') + } + return { + success: true, + output: { + expectedLineups: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + expectedLineups: { + type: 'array', + description: 'Array of expected lineup entries for the team', + items: { type: 'object', properties: SPORTMONKS_EXPECTED_LINEUP_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_extended_team_squad.ts b/apps/sim/tools/sportmonks_football/get_extended_team_squad.ts new file mode 100644 index 00000000000..20699366a5f --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_extended_team_squad.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SQUAD_PROPERTIES, + type SportmonksSquadEntry, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetExtendedTeamSquadParams extends SportmonksBaseParams { + teamId: string +} + +export interface SportmonksGetExtendedTeamSquadResponse extends ToolResponse { + output: { + squad: SportmonksSquadEntry[] + } +} + +export const sportmonksGetExtendedTeamSquadTool: ToolConfig< + SportmonksGetExtendedTeamSquadParams, + SportmonksGetExtendedTeamSquadResponse +> = { + id: 'sportmonks_football_get_extended_team_squad', + name: 'Get Extended Team Squad', + description: 'Retrieve all squad entries for a team (based on current seasons) by team ID', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. player;position)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/squads/teams/${encodeURIComponent(params.teamId.trim())}/extended` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_extended_team_squad') + } + return { + success: true, + output: { + squad: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + squad: { + type: 'array', + description: 'Array of extended squad entries for the team', + items: { type: 'object', properties: SPORTMONKS_SQUAD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_fixtures_by_date_range_for_team.ts b/apps/sim/tools/sportmonks_football/get_fixtures_by_date_range_for_team.ts new file mode 100644 index 00000000000..0f998cbc1bf --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_fixtures_by_date_range_for_team.ts @@ -0,0 +1,132 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetFixturesByDateRangeForTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + startDate: string + endDate: string + teamId: string +} + +export interface SportmonksGetFixturesByDateRangeForTeamResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetFixturesByDateRangeForTeamTool: ToolConfig< + SportmonksGetFixturesByDateRangeForTeamParams, + SportmonksGetFixturesByDateRangeForTeamResponse +> = { + id: 'sportmonks_football_get_fixtures_by_date_range_for_team', + name: 'Get Fixtures by Date Range for Team', + description: 'Retrieve fixtures for a team within a date range (YYYY-MM-DD) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + startDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start date in YYYY-MM-DD format', + }, + endDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End date in YYYY-MM-DD format', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order fixtures by starting_at (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/between/${encodeURIComponent( + params.startDate.trim() + )}/${encodeURIComponent(params.endDate.trim())}/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_fixtures_by_date_range_for_team') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of fixture objects for the team within the date range', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_fixtures_by_ids.ts b/apps/sim/tools/sportmonks_football/get_fixtures_by_ids.ts new file mode 100644 index 00000000000..3e5b6a2a3e9 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_fixtures_by_ids.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetFixturesByIdsParams extends SportmonksBaseParams { + ids: string +} + +export interface SportmonksGetFixturesByIdsResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + } +} + +export const sportmonksGetFixturesByIdsTool: ToolConfig< + SportmonksGetFixturesByIdsParams, + SportmonksGetFixturesByIdsResponse +> = { + id: 'sportmonks_football_get_fixtures_by_ids', + name: 'Get Fixtures by Multiple IDs', + description: 'Retrieve multiple football fixtures by a comma-separated list of IDs (max 50)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + ids: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Comma-separated fixture IDs (e.g. 18535517,18535518). Maximum of 50 IDs', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/multi/${encodeURIComponent(params.ids.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_fixtures_by_ids') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of fixture objects for the requested IDs', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_grouped_standings_by_round.ts b/apps/sim/tools/sportmonks_football/get_grouped_standings_by_round.ts new file mode 100644 index 00000000000..9fd418cf50e --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_grouped_standings_by_round.ts @@ -0,0 +1,87 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_FOOTBALL_BASE_URL } from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetGroupedStandingsByRoundParams extends SportmonksBaseParams { + roundId: string +} + +export interface SportmonksGetGroupedStandingsByRoundResponse extends ToolResponse { + output: { + standings: unknown[] + } +} + +export const sportmonksGetGroupedStandingsByRoundTool: ToolConfig< + SportmonksGetGroupedStandingsByRoundParams, + SportmonksGetGroupedStandingsByRoundResponse +> = { + id: 'sportmonks_football_get_grouped_standings_by_round', + name: 'Get Grouped Standings by Round', + description: + 'Retrieve the standing table for a round ID grouped by group where applicable from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + roundId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the round', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. standingGroups:246697)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/standings/rounds/${encodeURIComponent(params.roundId.trim())}/grouped` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_grouped_standings_by_round') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + standings: { + type: 'json', + description: + 'Standings for the round: an array of groups (each with id, name and a standings array) when groups exist, otherwise a flat array of standing entries', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_coaches.ts b/apps/sim/tools/sportmonks_football/get_latest_coaches.ts new file mode 100644 index 00000000000..838950deda7 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_coaches.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COACH_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCoach, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestCoachesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetLatestCoachesResponse extends ToolResponse { + output: { + coaches: SportmonksCoach[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLatestCoachesTool: ToolConfig< + SportmonksGetLatestCoachesParams, + SportmonksGetLatestCoachesResponse +> = { + id: 'sportmonks_football_get_latest_coaches', + name: 'Get Last Updated Coaches', + description: 'Retrieve all coaches that have received updates in the past two hours', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;nationality)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/coaches/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_coaches') + } + return { + success: true, + output: { + coaches: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + coaches: { + type: 'array', + description: 'Array of recently updated coach objects', + items: { type: 'object', properties: SPORTMONKS_COACH_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_fixtures.ts b/apps/sim/tools/sportmonks_football/get_latest_fixtures.ts new file mode 100644 index 00000000000..61054ab1ce4 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_fixtures.ts @@ -0,0 +1,80 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestFixturesParams extends SportmonksBaseParams {} + +export interface SportmonksGetLatestFixturesResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + } +} + +export const sportmonksGetLatestFixturesTool: ToolConfig< + SportmonksGetLatestFixturesParams, + SportmonksGetLatestFixturesResponse +> = { + id: 'sportmonks_football_get_latest_fixtures', + name: 'Get Latest Updated Fixtures', + description: 'Retrieve all fixtures that have received updates within the last 10 seconds', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_fixtures') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of recently updated fixture objects', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_livescores.ts b/apps/sim/tools/sportmonks_football/get_latest_livescores.ts new file mode 100644 index 00000000000..8034d3cdc9a --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_livescores.ts @@ -0,0 +1,80 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestLivescoresParams extends SportmonksBaseParams {} + +export interface SportmonksGetLatestLivescoresResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + } +} + +export const sportmonksGetLatestLivescoresTool: ToolConfig< + SportmonksGetLatestLivescoresParams, + SportmonksGetLatestLivescoresResponse +> = { + id: 'sportmonks_football_get_latest_livescores', + name: 'Get Latest Updated Livescores', + description: 'Retrieve all livescores that have received updates within the last 10 seconds', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/livescores/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_livescores') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of recently updated live fixture objects', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_players.ts b/apps/sim/tools/sportmonks_football/get_latest_players.ts new file mode 100644 index 00000000000..8e7b17c9ad6 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_players.ts @@ -0,0 +1,80 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PLAYER_PROPERTIES, + type SportmonksPlayer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestPlayersParams extends SportmonksBaseParams {} + +export interface SportmonksGetLatestPlayersResponse extends ToolResponse { + output: { + players: SportmonksPlayer[] + } +} + +export const sportmonksGetLatestPlayersTool: ToolConfig< + SportmonksGetLatestPlayersParams, + SportmonksGetLatestPlayersResponse +> = { + id: 'sportmonks_football_get_latest_players', + name: 'Get Last Updated Players', + description: 'Retrieve all players that have received updates in the past two hours', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. nationality;position)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/players/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_players') + } + return { + success: true, + output: { + players: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + players: { + type: 'array', + description: 'Array of recently updated player objects', + items: { type: 'object', properties: SPORTMONKS_PLAYER_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_totw.ts b/apps/sim/tools/sportmonks_football/get_latest_totw.ts new file mode 100644 index 00000000000..41ba7cad8ab --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_totw.ts @@ -0,0 +1,84 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TOTW_PROPERTIES, + type SportmonksTotw, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestTotwParams extends SportmonksBaseParams { + leagueId: string +} + +export interface SportmonksGetLatestTotwResponse extends ToolResponse { + output: { + totw: SportmonksTotw[] + } +} + +export const sportmonksGetLatestTotwTool: ToolConfig< + SportmonksGetLatestTotwParams, + SportmonksGetLatestTotwResponse +> = { + id: 'sportmonks_football_get_latest_totw', + name: 'Get Latest Team of the Week', + description: 'Retrieve the latest Team of the Week (TOTW) for a league ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + leagueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the league', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fixture;team;player;round)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/team-of-the-week/leagues/${encodeURIComponent(params.leagueId.trim())}/latest` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_totw') + } + return { + success: true, + output: { + totw: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + totw: { + type: 'array', + description: 'Array of the latest Team of the Week entries for the league', + items: { type: 'object', properties: SPORTMONKS_TOTW_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_latest_transfers.ts b/apps/sim/tools/sportmonks_football/get_latest_transfers.ts new file mode 100644 index 00000000000..7137712c4f4 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_latest_transfers.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLatestTransfersParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetLatestTransfersResponse extends ToolResponse { + output: { + transfers: SportmonksTransfer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLatestTransfersTool: ToolConfig< + SportmonksGetLatestTransfersParams, + SportmonksGetLatestTransfersResponse +> = { + id: 'sportmonks_football_get_latest_transfers', + name: 'Get Latest Transfers', + description: 'Retrieve the latest transfers available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. transferTypes:219,220)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/transfers/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_transfers') + } + return { + success: true, + output: { + transfers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transfers: { + type: 'array', + description: 'Array of the latest transfer objects', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_leagues_by_country.ts b/apps/sim/tools/sportmonks_football/get_leagues_by_country.ts new file mode 100644 index 00000000000..03a1caa1e07 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_leagues_by_country.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLeaguesByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksGetLeaguesByCountryResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLeaguesByCountryTool: ToolConfig< + SportmonksGetLeaguesByCountryParams, + SportmonksGetLeaguesByCountryResponse +> = { + id: 'sportmonks_football_get_leagues_by_country', + name: 'Get Leagues by Country', + description: 'Retrieve all leagues for a country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_country') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects for the country', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_leagues_by_date.ts b/apps/sim/tools/sportmonks_football/get_leagues_by_date.ts new file mode 100644 index 00000000000..db2c44aaa54 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_leagues_by_date.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLeaguesByDateParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + date: string +} + +export interface SportmonksGetLeaguesByDateResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLeaguesByDateTool: ToolConfig< + SportmonksGetLeaguesByDateParams, + SportmonksGetLeaguesByDateResponse +> = { + id: 'sportmonks_football_get_leagues_by_date', + name: 'Get Leagues by Date', + description: 'Retrieve all leagues with fixtures on a given date (YYYY-MM-DD) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + date: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The fixture date in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/date/${encodeURIComponent(params.date.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_date') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects with fixtures on the requested date', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_leagues_by_team.ts b/apps/sim/tools/sportmonks_football/get_leagues_by_team.ts new file mode 100644 index 00000000000..342494e43d1 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_leagues_by_team.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLeaguesByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetLeaguesByTeamResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLeaguesByTeamTool: ToolConfig< + SportmonksGetLeaguesByTeamParams, + SportmonksGetLeaguesByTeamResponse +> = { + id: 'sportmonks_football_get_leagues_by_team', + name: 'Get Leagues by Team', + description: 'Retrieve all current and historical leagues for a team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_team') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of current and historical league objects for the team', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_live_leagues.ts b/apps/sim/tools/sportmonks_football/get_live_leagues.ts new file mode 100644 index 00000000000..3c2a22c2c5e --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_live_leagues.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLiveLeaguesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetLiveLeaguesResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLiveLeaguesTool: ToolConfig< + SportmonksGetLiveLeaguesParams, + SportmonksGetLiveLeaguesResponse +> = { + id: 'sportmonks_football_get_live_leagues', + name: 'Get Live Leagues', + description: 'Retrieve all leagues that have fixtures currently being played from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/live`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_live_leagues') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of currently live league objects', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_live_probabilities.ts b/apps/sim/tools/sportmonks_football/get_live_probabilities.ts new file mode 100644 index 00000000000..51c8f3dcfe4 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_live_probabilities.ts @@ -0,0 +1,102 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LIVE_PROBABILITY_PROPERTIES, + type SportmonksLiveProbability, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLiveProbabilitiesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetLiveProbabilitiesResponse extends ToolResponse { + output: { + predictions: SportmonksLiveProbability[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLiveProbabilitiesTool: ToolConfig< + SportmonksGetLiveProbabilitiesParams, + SportmonksGetLiveProbabilitiesResponse +> = { + id: 'sportmonks_football_get_live_probabilities', + name: 'Get Live Probabilities', + description: 'Retrieve all live (in-play) prediction probabilities from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery( + `${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/live/probabilities`, + params + ), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_live_probabilities') + } + return { + success: true, + output: { + predictions: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + predictions: { + type: 'array', + description: 'Array of live probability prediction objects', + items: { type: 'object', properties: SPORTMONKS_LIVE_PROBABILITY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_live_probabilities_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_live_probabilities_by_fixture.ts new file mode 100644 index 00000000000..b60e5370e8c --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_live_probabilities_by_fixture.ts @@ -0,0 +1,110 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LIVE_PROBABILITY_PROPERTIES, + type SportmonksLiveProbability, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLiveProbabilitiesByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetLiveProbabilitiesByFixtureResponse extends ToolResponse { + output: { + predictions: SportmonksLiveProbability[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetLiveProbabilitiesByFixtureTool: ToolConfig< + SportmonksGetLiveProbabilitiesByFixtureParams, + SportmonksGetLiveProbabilitiesByFixtureResponse +> = { + id: 'sportmonks_football_get_live_probabilities_by_fixture', + name: 'Get Live Probabilities by Fixture', + description: + 'Retrieve all live (in-play) prediction probabilities for a fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/live/probabilities/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_live_probabilities_by_fixture') + } + return { + success: true, + output: { + predictions: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + predictions: { + type: 'array', + description: 'Array of live probability prediction objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_LIVE_PROBABILITY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_live_standings_by_league.ts b/apps/sim/tools/sportmonks_football/get_live_standings_by_league.ts new file mode 100644 index 00000000000..7635098992b --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_live_standings_by_league.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STANDING_PROPERTIES, + type SportmonksStanding, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLiveStandingsByLeagueParams extends SportmonksBaseParams { + leagueId: string +} + +export interface SportmonksGetLiveStandingsByLeagueResponse extends ToolResponse { + output: { + standings: SportmonksStanding[] + } +} + +export const sportmonksGetLiveStandingsByLeagueTool: ToolConfig< + SportmonksGetLiveStandingsByLeagueParams, + SportmonksGetLiveStandingsByLeagueResponse +> = { + id: 'sportmonks_football_get_live_standings_by_league', + name: 'Get Live Standings by League', + description: 'Retrieve the live standing table for a league ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + leagueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the league', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. standingGroups:246697)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/standings/live/leagues/${encodeURIComponent(params.leagueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_live_standings_by_league') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + standings: { + type: 'array', + description: 'Array of live standing entries for the league', + items: { type: 'object', properties: SPORTMONKS_STANDING_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_match_facts.ts b/apps/sim/tools/sportmonks_football/get_match_facts.ts new file mode 100644 index 00000000000..12509e39f51 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_match_facts.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_MATCH_FACT_PROPERTIES, + type SportmonksMatchFact, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetMatchFactsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetMatchFactsResponse extends ToolResponse { + output: { + matchFacts: SportmonksMatchFact[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetMatchFactsTool: ToolConfig< + SportmonksGetMatchFactsParams, + SportmonksGetMatchFactsResponse +> = { + id: 'sportmonks_football_get_match_facts', + name: 'Get All Match Facts', + description: 'Retrieve all available match facts within your Sportmonks subscription (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;sport;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. matchFactTypes:76088)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/match-facts`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_match_facts') + } + return { + success: true, + output: { + matchFacts: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + matchFacts: { + type: 'array', + description: 'Array of match fact objects', + items: { type: 'object', properties: SPORTMONKS_MATCH_FACT_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_match_facts_by_date_range.ts b/apps/sim/tools/sportmonks_football/get_match_facts_by_date_range.ts new file mode 100644 index 00000000000..271815d1aa9 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_match_facts_by_date_range.ts @@ -0,0 +1,124 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_MATCH_FACT_PROPERTIES, + type SportmonksMatchFact, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetMatchFactsByDateRangeParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + startDate: string + endDate: string +} + +export interface SportmonksGetMatchFactsByDateRangeResponse extends ToolResponse { + output: { + matchFacts: SportmonksMatchFact[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetMatchFactsByDateRangeTool: ToolConfig< + SportmonksGetMatchFactsByDateRangeParams, + SportmonksGetMatchFactsByDateRangeResponse +> = { + id: 'sportmonks_football_get_match_facts_by_date_range', + name: 'Get Match Facts by Date Range', + description: 'Retrieve match facts within a date range (YYYY-MM-DD) from Sportmonks (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + startDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start date in YYYY-MM-DD format', + }, + endDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End date in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;sport;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. matchFactTypes:76088)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/match-facts/fixtures/between/${encodeURIComponent( + params.startDate.trim() + )}/${encodeURIComponent(params.endDate.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_match_facts_by_date_range') + } + return { + success: true, + output: { + matchFacts: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + matchFacts: { + type: 'array', + description: 'Array of match fact objects within the date range', + items: { type: 'object', properties: SPORTMONKS_MATCH_FACT_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_match_facts_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_match_facts_by_fixture.ts new file mode 100644 index 00000000000..1faa2d5b864 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_match_facts_by_fixture.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_MATCH_FACT_PROPERTIES, + type SportmonksMatchFact, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetMatchFactsByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetMatchFactsByFixtureResponse extends ToolResponse { + output: { + matchFacts: SportmonksMatchFact[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetMatchFactsByFixtureTool: ToolConfig< + SportmonksGetMatchFactsByFixtureParams, + SportmonksGetMatchFactsByFixtureResponse +> = { + id: 'sportmonks_football_get_match_facts_by_fixture', + name: 'Get Match Facts by Fixture', + description: 'Retrieve match facts for a fixture ID from Sportmonks (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;sport;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. matchFactTypes:76088)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/match-facts/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_match_facts_by_fixture') + } + return { + success: true, + output: { + matchFacts: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + matchFacts: { + type: 'array', + description: 'Array of match fact objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_MATCH_FACT_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_match_facts_by_league.ts b/apps/sim/tools/sportmonks_football/get_match_facts_by_league.ts new file mode 100644 index 00000000000..ba75c97ac3b --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_match_facts_by_league.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_MATCH_FACT_PROPERTIES, + type SportmonksMatchFact, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetMatchFactsByLeagueParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + leagueId: string +} + +export interface SportmonksGetMatchFactsByLeagueResponse extends ToolResponse { + output: { + matchFacts: SportmonksMatchFact[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetMatchFactsByLeagueTool: ToolConfig< + SportmonksGetMatchFactsByLeagueParams, + SportmonksGetMatchFactsByLeagueResponse +> = { + id: 'sportmonks_football_get_match_facts_by_league', + name: 'Get Match Facts by League', + description: 'Retrieve match facts for a league ID from Sportmonks (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + leagueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the league', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;sport;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. matchFactTypes:76088)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/match-facts/leagues/${encodeURIComponent(params.leagueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_match_facts_by_league') + } + return { + success: true, + output: { + matchFacts: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + matchFacts: { + type: 'array', + description: 'Array of match fact objects for the league', + items: { type: 'object', properties: SPORTMONKS_MATCH_FACT_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_past_fixtures_by_tv_station.ts b/apps/sim/tools/sportmonks_football/get_past_fixtures_by_tv_station.ts new file mode 100644 index 00000000000..d66542942a8 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_past_fixtures_by_tv_station.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPastFixturesByTvStationParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + tvStationId: string +} + +export interface SportmonksGetPastFixturesByTvStationResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPastFixturesByTvStationTool: ToolConfig< + SportmonksGetPastFixturesByTvStationParams, + SportmonksGetPastFixturesByTvStationResponse +> = { + id: 'sportmonks_football_get_past_fixtures_by_tv_station', + name: 'Get Past Fixtures by TV Station', + description: 'Retrieve all past fixtures that were available for a TV station ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + tvStationId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the TV station', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participants)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/past/tv-stations/${encodeURIComponent(params.tvStationId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_past_fixtures_by_tv_station') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of past fixture objects for the TV station', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_players_by_country.ts b/apps/sim/tools/sportmonks_football/get_players_by_country.ts new file mode 100644 index 00000000000..54c6e4120c6 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_players_by_country.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PLAYER_PROPERTIES, + type SportmonksPlayer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPlayersByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksGetPlayersByCountryResponse extends ToolResponse { + output: { + players: SportmonksPlayer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPlayersByCountryTool: ToolConfig< + SportmonksGetPlayersByCountryParams, + SportmonksGetPlayersByCountryResponse +> = { + id: 'sportmonks_football_get_players_by_country', + name: 'Get Players by Country', + description: 'Retrieve all players for a country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. nationality;position)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order players by id (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/players/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_players_by_country') + } + return { + success: true, + output: { + players: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + players: { + type: 'array', + description: 'Array of player objects for the country', + items: { type: 'object', properties: SPORTMONKS_PLAYER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_postmatch_news.ts b/apps/sim/tools/sportmonks_football/get_postmatch_news.ts new file mode 100644 index 00000000000..c5f97bd9747 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_postmatch_news.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_NEWS_PROPERTIES, + type SportmonksNews, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPostmatchNewsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetPostmatchNewsResponse extends ToolResponse { + output: { + news: SportmonksNews[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPostmatchNewsTool: ToolConfig< + SportmonksGetPostmatchNewsParams, + SportmonksGetPostmatchNewsResponse +> = { + id: 'sportmonks_football_get_postmatch_news', + name: 'Get Post-Match News', + description: + 'Retrieve all post-match news articles available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. newsitemLeagues:8)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order news by id (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/news/post-match`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_postmatch_news') + } + return { + success: true, + output: { + news: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + news: { + type: 'array', + description: 'Array of post-match news articles', + items: { type: 'object', properties: SPORTMONKS_NEWS_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_postmatch_news_by_season.ts b/apps/sim/tools/sportmonks_football/get_postmatch_news_by_season.ts new file mode 100644 index 00000000000..ac85500fb49 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_postmatch_news_by_season.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_NEWS_PROPERTIES, + type SportmonksNews, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPostmatchNewsBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksGetPostmatchNewsBySeasonResponse extends ToolResponse { + output: { + news: SportmonksNews[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPostmatchNewsBySeasonTool: ToolConfig< + SportmonksGetPostmatchNewsBySeasonParams, + SportmonksGetPostmatchNewsBySeasonResponse +> = { + id: 'sportmonks_football_get_postmatch_news_by_season', + name: 'Get Post-Match News by Season', + description: 'Retrieve all post-match news articles for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. newsitemLeagues:8)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order news (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/news/post-match/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_postmatch_news_by_season') + } + return { + success: true, + output: { + news: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + news: { + type: 'array', + description: 'Array of post-match news articles for the season', + items: { type: 'object', properties: SPORTMONKS_NEWS_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_predictability_by_league.ts b/apps/sim/tools/sportmonks_football/get_predictability_by_league.ts new file mode 100644 index 00000000000..fc3fe92497f --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_predictability_by_league.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PREDICTABILITY_PROPERTIES, + type SportmonksPredictability, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPredictabilityByLeagueParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + leagueId: string +} + +export interface SportmonksGetPredictabilityByLeagueResponse extends ToolResponse { + output: { + predictability: SportmonksPredictability[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPredictabilityByLeagueTool: ToolConfig< + SportmonksGetPredictabilityByLeagueParams, + SportmonksGetPredictabilityByLeagueResponse +> = { + id: 'sportmonks_football_get_predictability_by_league', + name: 'Get Predictability by League', + description: 'Retrieve the predictions model performance for a league ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + leagueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the league', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. predictabilityTypes:245)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/predictability/leagues/${encodeURIComponent(params.leagueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_predictability_by_league') + } + return { + success: true, + output: { + predictability: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + predictability: { + type: 'array', + description: 'Array of predictability records for the league', + items: { type: 'object', properties: SPORTMONKS_PREDICTABILITY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_prematch_news.ts b/apps/sim/tools/sportmonks_football/get_prematch_news.ts new file mode 100644 index 00000000000..e2676de2ba5 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_prematch_news.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_NEWS_PROPERTIES, + type SportmonksNews, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPrematchNewsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetPrematchNewsResponse extends ToolResponse { + output: { + news: SportmonksNews[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPrematchNewsTool: ToolConfig< + SportmonksGetPrematchNewsParams, + SportmonksGetPrematchNewsResponse +> = { + id: 'sportmonks_football_get_prematch_news', + name: 'Get Pre-Match News', + description: 'Retrieve all pre-match news articles available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. newsitemLeagues:8)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order news by id (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/news/pre-match`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_prematch_news') + } + return { + success: true, + output: { + news: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + news: { + type: 'array', + description: 'Array of pre-match news articles', + items: { type: 'object', properties: SPORTMONKS_NEWS_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_prematch_news_by_season.ts b/apps/sim/tools/sportmonks_football/get_prematch_news_by_season.ts new file mode 100644 index 00000000000..378981bac84 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_prematch_news_by_season.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_NEWS_PROPERTIES, + type SportmonksNews, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPrematchNewsBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksGetPrematchNewsBySeasonResponse extends ToolResponse { + output: { + news: SportmonksNews[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPrematchNewsBySeasonTool: ToolConfig< + SportmonksGetPrematchNewsBySeasonParams, + SportmonksGetPrematchNewsBySeasonResponse +> = { + id: 'sportmonks_football_get_prematch_news_by_season', + name: 'Get Pre-Match News by Season', + description: 'Retrieve all pre-match news articles for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. newsitemLeagues:8)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order news (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/news/pre-match/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_prematch_news_by_season') + } + return { + success: true, + output: { + news: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + news: { + type: 'array', + description: 'Array of pre-match news articles for the season', + items: { type: 'object', properties: SPORTMONKS_NEWS_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_prematch_news_upcoming.ts b/apps/sim/tools/sportmonks_football/get_prematch_news_upcoming.ts new file mode 100644 index 00000000000..06e8b22bd7c --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_prematch_news_upcoming.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_NEWS_PROPERTIES, + type SportmonksNews, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPrematchNewsUpcomingParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetPrematchNewsUpcomingResponse extends ToolResponse { + output: { + news: SportmonksNews[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetPrematchNewsUpcomingTool: ToolConfig< + SportmonksGetPrematchNewsUpcomingParams, + SportmonksGetPrematchNewsUpcomingResponse +> = { + id: 'sportmonks_football_get_prematch_news_upcoming', + name: 'Get Pre-Match News for Upcoming Fixtures', + description: 'Retrieve all pre-match news articles for upcoming fixtures from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixture;league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. newsitemLeagues:8)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order news (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/news/pre-match/upcoming`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_prematch_news_upcoming') + } + return { + success: true, + output: { + news: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + news: { + type: 'array', + description: 'Array of pre-match news articles for upcoming fixtures', + items: { type: 'object', properties: SPORTMONKS_NEWS_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_probabilities.ts b/apps/sim/tools/sportmonks_football/get_probabilities.ts new file mode 100644 index 00000000000..088cf6fa764 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_probabilities.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PREDICTION_PROPERTIES, + type SportmonksPrediction, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetProbabilitiesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetProbabilitiesResponse extends ToolResponse { + output: { + predictions: SportmonksPrediction[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetProbabilitiesTool: ToolConfig< + SportmonksGetProbabilitiesParams, + SportmonksGetProbabilitiesResponse +> = { + id: 'sportmonks_football_get_probabilities', + name: 'Get Probabilities', + description: + 'Retrieve all prediction probabilities available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. predictionTypes:236)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/probabilities`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_probabilities') + } + return { + success: true, + output: { + predictions: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + predictions: { + type: 'array', + description: 'Array of prediction probability objects', + items: { type: 'object', properties: SPORTMONKS_PREDICTION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_probabilities_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_probabilities_by_fixture.ts new file mode 100644 index 00000000000..c8fcf16235f --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_probabilities_by_fixture.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PREDICTION_PROPERTIES, + type SportmonksPrediction, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetProbabilitiesByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetProbabilitiesByFixtureResponse extends ToolResponse { + output: { + predictions: SportmonksPrediction[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetProbabilitiesByFixtureTool: ToolConfig< + SportmonksGetProbabilitiesByFixtureParams, + SportmonksGetProbabilitiesByFixtureResponse +> = { + id: 'sportmonks_football_get_probabilities_by_fixture', + name: 'Get Predictions by Fixture', + description: 'Retrieve prediction probabilities for a fixture by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. predictionTypes:236)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/probabilities/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_probabilities_by_fixture') + } + return { + success: true, + output: { + predictions: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + predictions: { + type: 'array', + description: 'Array of prediction probability entries for the fixture', + items: { type: 'object', properties: SPORTMONKS_PREDICTION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_referee.ts b/apps/sim/tools/sportmonks_football/get_referee.ts new file mode 100644 index 00000000000..af77a486fbf --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_referee.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_REFEREE_PROPERTIES, + type SportmonksReferee, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRefereeParams extends SportmonksBaseParams { + refereeId: string +} + +export interface SportmonksGetRefereeResponse extends ToolResponse { + output: { + referee: SportmonksReferee | null + } +} + +export const sportmonksGetRefereeTool: ToolConfig< + SportmonksGetRefereeParams, + SportmonksGetRefereeResponse +> = { + id: 'sportmonks_football_get_referee', + name: 'Get Referee by ID', + description: 'Retrieve a single football referee by their ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + refereeId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the referee', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;statistics)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/referees/${encodeURIComponent(params.refereeId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_referee') + } + return { + success: true, + output: { + referee: data.data ?? null, + }, + } + }, + + outputs: { + referee: { + type: 'object', + description: 'The requested referee object', + properties: SPORTMONKS_REFEREE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_referees.ts b/apps/sim/tools/sportmonks_football/get_referees.ts new file mode 100644 index 00000000000..e2d6d630c31 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_referees.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_REFEREE_PROPERTIES, + type SportmonksReferee, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRefereesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetRefereesResponse extends ToolResponse { + output: { + referees: SportmonksReferee[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetRefereesTool: ToolConfig< + SportmonksGetRefereesParams, + SportmonksGetRefereesResponse +> = { + id: 'sportmonks_football_get_referees', + name: 'Get Referees', + description: 'Retrieve all football referees available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;statistics)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. refereeCountries:44)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/referees`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_referees') + } + return { + success: true, + output: { + referees: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + referees: { + type: 'array', + description: 'Array of referee objects', + items: { type: 'object', properties: SPORTMONKS_REFEREE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_referees_by_country.ts b/apps/sim/tools/sportmonks_football/get_referees_by_country.ts new file mode 100644 index 00000000000..c69c5028586 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_referees_by_country.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_REFEREE_PROPERTIES, + type SportmonksReferee, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRefereesByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksGetRefereesByCountryResponse extends ToolResponse { + output: { + referees: SportmonksReferee[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetRefereesByCountryTool: ToolConfig< + SportmonksGetRefereesByCountryParams, + SportmonksGetRefereesByCountryResponse +> = { + id: 'sportmonks_football_get_referees_by_country', + name: 'Get Referees by Country', + description: 'Retrieve all referees for a country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;nationality)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/referees/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_referees_by_country') + } + return { + success: true, + output: { + referees: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + referees: { + type: 'array', + description: 'Array of referee objects for the country', + items: { type: 'object', properties: SPORTMONKS_REFEREE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_referees_by_season.ts b/apps/sim/tools/sportmonks_football/get_referees_by_season.ts new file mode 100644 index 00000000000..eaa8bb91790 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_referees_by_season.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_REFEREE_PROPERTIES, + type SportmonksReferee, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRefereesBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksGetRefereesBySeasonResponse extends ToolResponse { + output: { + referees: SportmonksReferee[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetRefereesBySeasonTool: ToolConfig< + SportmonksGetRefereesBySeasonParams, + SportmonksGetRefereesBySeasonResponse +> = { + id: 'sportmonks_football_get_referees_by_season', + name: 'Get Referees by Season', + description: 'Retrieve all referees for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;nationality)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/referees/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_referees_by_season') + } + return { + success: true, + output: { + referees: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + referees: { + type: 'array', + description: 'Array of referee objects for the season', + items: { type: 'object', properties: SPORTMONKS_REFEREE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_rivals_by_team.ts b/apps/sim/tools/sportmonks_football/get_rivals_by_team.ts new file mode 100644 index 00000000000..bdfff82d89d --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_rivals_by_team.ts @@ -0,0 +1,83 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_RIVAL_PROPERTIES, + type SportmonksRival, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRivalsByTeamParams extends SportmonksBaseParams { + teamId: string +} + +export interface SportmonksGetRivalsByTeamResponse extends ToolResponse { + output: { + rivals: SportmonksRival[] + } +} + +export const sportmonksGetRivalsByTeamTool: ToolConfig< + SportmonksGetRivalsByTeamParams, + SportmonksGetRivalsByTeamResponse +> = { + id: 'sportmonks_football_get_rivals_by_team', + name: 'Get Rivals by Team', + description: 'Retrieve rival teams for a team by team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. team;rival)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/rivals/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_rivals_by_team') + } + return { + success: true, + output: { + rivals: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + rivals: { + type: 'array', + description: 'Array of rival relationships for the team', + items: { type: 'object', properties: SPORTMONKS_RIVAL_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_round.ts b/apps/sim/tools/sportmonks_football/get_round.ts new file mode 100644 index 00000000000..df469177561 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_round.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_ROUND_PROPERTIES, + type SportmonksRound, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRoundParams extends SportmonksBaseParams { + roundId: string +} + +export interface SportmonksGetRoundResponse extends ToolResponse { + output: { + round: SportmonksRound | null + } +} + +export const sportmonksGetRoundTool: ToolConfig< + SportmonksGetRoundParams, + SportmonksGetRoundResponse +> = { + id: 'sportmonks_football_get_round', + name: 'Get Round by ID', + description: 'Retrieve a single football round by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + roundId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the round', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;stage;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/rounds/${encodeURIComponent(params.roundId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_round') + } + return { + success: true, + output: { + round: data.data ?? null, + }, + } + }, + + outputs: { + round: { + type: 'object', + description: 'The requested round object', + properties: SPORTMONKS_ROUND_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_round_statistics.ts b/apps/sim/tools/sportmonks_football/get_round_statistics.ts new file mode 100644 index 00000000000..119024e3a6b --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_round_statistics.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STATISTIC_PROPERTIES, + type SportmonksStatistic, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRoundStatisticsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + roundId: string +} + +export interface SportmonksGetRoundStatisticsResponse extends ToolResponse { + output: { + statistics: SportmonksStatistic[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetRoundStatisticsTool: ToolConfig< + SportmonksGetRoundStatisticsParams, + SportmonksGetRoundStatisticsResponse +> = { + id: 'sportmonks_football_get_round_statistics', + name: 'Get Round Statistics', + description: 'Retrieve all available statistics for a round ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + roundId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the round', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participant)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. seasonstatisticTypes:52,88)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/statistics/rounds/${encodeURIComponent(params.roundId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_round_statistics') + } + return { + success: true, + output: { + statistics: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + statistics: { + type: 'array', + description: 'Array of statistic entries for the round', + items: { type: 'object', properties: SPORTMONKS_STATISTIC_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_rounds.ts b/apps/sim/tools/sportmonks_football/get_rounds.ts new file mode 100644 index 00000000000..2503e34f0d9 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_rounds.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_ROUND_PROPERTIES, + type SportmonksRound, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRoundsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetRoundsResponse extends ToolResponse { + output: { + rounds: SportmonksRound[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetRoundsTool: ToolConfig< + SportmonksGetRoundsParams, + SportmonksGetRoundsResponse +> = { + id: 'sportmonks_football_get_rounds', + name: 'Get Rounds', + description: 'Retrieve all football rounds available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;stage)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. roundSeasons:19735)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/rounds`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_rounds') + } + return { + success: true, + output: { + rounds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + rounds: { + type: 'array', + description: 'Array of round objects', + items: { type: 'object', properties: SPORTMONKS_ROUND_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_rounds_by_season.ts b/apps/sim/tools/sportmonks_football/get_rounds_by_season.ts new file mode 100644 index 00000000000..47c9dbda155 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_rounds_by_season.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_ROUND_PROPERTIES, + type SportmonksRound, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetRoundsBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetRoundsBySeasonResponse extends ToolResponse { + output: { + rounds: SportmonksRound[] + } +} + +export const sportmonksGetRoundsBySeasonTool: ToolConfig< + SportmonksGetRoundsBySeasonParams, + SportmonksGetRoundsBySeasonResponse +> = { + id: 'sportmonks_football_get_rounds_by_season', + name: 'Get Rounds by Season', + description: 'Retrieve all rounds for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;stage)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/rounds/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_rounds_by_season') + } + return { + success: true, + output: { + rounds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + rounds: { + type: 'array', + description: 'Array of round objects for the season', + items: { type: 'object', properties: SPORTMONKS_ROUND_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_schedules_by_season.ts b/apps/sim/tools/sportmonks_football/get_schedules_by_season.ts new file mode 100644 index 00000000000..c2a3a6fcfe3 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_schedules_by_season.ts @@ -0,0 +1,73 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_FOOTBALL_BASE_URL } from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSchedulesBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetSchedulesBySeasonResponse extends ToolResponse { + output: { + schedules: unknown[] + } +} + +export const sportmonksGetSchedulesBySeasonTool: ToolConfig< + SportmonksGetSchedulesBySeasonParams, + SportmonksGetSchedulesBySeasonResponse +> = { + id: 'sportmonks_football_get_schedules_by_season', + name: 'Get Schedules by Season', + description: 'Retrieve the full schedule (stages, rounds and fixtures) for a season by season ID', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/schedules/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_schedules_by_season') + } + return { + success: true, + output: { + schedules: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + schedules: { + type: 'json', + description: + 'Array of stages, each with nested rounds and their fixtures (participants, scores)', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_schedules_by_season_and_team.ts b/apps/sim/tools/sportmonks_football/get_schedules_by_season_and_team.ts new file mode 100644 index 00000000000..63b55349c17 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_schedules_by_season_and_team.ts @@ -0,0 +1,82 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_FOOTBALL_BASE_URL } from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSchedulesBySeasonAndTeamParams extends SportmonksBaseParams { + seasonId: string + teamId: string +} + +export interface SportmonksGetSchedulesBySeasonAndTeamResponse extends ToolResponse { + output: { + schedules: unknown[] + } +} + +export const sportmonksGetSchedulesBySeasonAndTeamTool: ToolConfig< + SportmonksGetSchedulesBySeasonAndTeamParams, + SportmonksGetSchedulesBySeasonAndTeamResponse +> = { + id: 'sportmonks_football_get_schedules_by_season_and_team', + name: 'Get Schedules by Season and Team', + description: 'Retrieve the full season schedule for a specific team by season ID and team ID', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/schedules/seasons/${encodeURIComponent( + params.seasonId.trim() + )}/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_schedules_by_season_and_team') + } + return { + success: true, + output: { + schedules: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + schedules: { + type: 'json', + description: + 'Array of stages, each with nested rounds and their fixtures for the team in the season', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_schedules_by_team.ts b/apps/sim/tools/sportmonks_football/get_schedules_by_team.ts new file mode 100644 index 00000000000..2c2986a5f34 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_schedules_by_team.ts @@ -0,0 +1,73 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { SPORTMONKS_FOOTBALL_BASE_URL } from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSchedulesByTeamParams extends SportmonksBaseParams { + teamId: string +} + +export interface SportmonksGetSchedulesByTeamResponse extends ToolResponse { + output: { + schedules: unknown[] + } +} + +export const sportmonksGetSchedulesByTeamTool: ToolConfig< + SportmonksGetSchedulesByTeamParams, + SportmonksGetSchedulesByTeamResponse +> = { + id: 'sportmonks_football_get_schedules_by_team', + name: 'Get Schedules by Team', + description: 'Retrieve the full schedule (stages, rounds and fixtures) for a team by team ID', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/schedules/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_schedules_by_team') + } + return { + success: true, + output: { + schedules: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + schedules: { + type: 'json', + description: + 'Array of stages, each with nested rounds and their fixtures (participants, scores)', + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_season.ts b/apps/sim/tools/sportmonks_football/get_season.ts new file mode 100644 index 00000000000..327c4b60a49 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_season.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SEASON_PROPERTIES, + type SportmonksSeason, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetSeasonResponse extends ToolResponse { + output: { + season: SportmonksSeason | null + } +} + +export const sportmonksGetSeasonTool: ToolConfig< + SportmonksGetSeasonParams, + SportmonksGetSeasonResponse +> = { + id: 'sportmonks_football_get_season', + name: 'Get Season by ID', + description: 'Retrieve a single football season by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;stages;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_season') + } + return { + success: true, + output: { + season: data.data ?? null, + }, + } + }, + + outputs: { + season: { + type: 'object', + description: 'The requested season object', + properties: SPORTMONKS_SEASON_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_seasons.ts b/apps/sim/tools/sportmonks_football/get_seasons.ts new file mode 100644 index 00000000000..adc29cea87c --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_seasons.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SEASON_PROPERTIES, + type SportmonksSeason, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSeasonsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetSeasonsResponse extends ToolResponse { + output: { + seasons: SportmonksSeason[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetSeasonsTool: ToolConfig< + SportmonksGetSeasonsParams, + SportmonksGetSeasonsResponse +> = { + id: 'sportmonks_football_get_seasons', + name: 'Get Seasons', + description: 'Retrieve all football seasons available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;stages)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. seasonLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/seasons`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_seasons') + } + return { + success: true, + output: { + seasons: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + seasons: { + type: 'array', + description: 'Array of season objects', + items: { type: 'object', properties: SPORTMONKS_SEASON_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_seasons_by_team.ts b/apps/sim/tools/sportmonks_football/get_seasons_by_team.ts new file mode 100644 index 00000000000..adcdffc84e7 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_seasons_by_team.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SEASON_PROPERTIES, + type SportmonksSeason, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetSeasonsByTeamParams extends SportmonksBaseParams { + teamId: string +} + +export interface SportmonksGetSeasonsByTeamResponse extends ToolResponse { + output: { + seasons: SportmonksSeason[] + } +} + +export const sportmonksGetSeasonsByTeamTool: ToolConfig< + SportmonksGetSeasonsByTeamParams, + SportmonksGetSeasonsByTeamResponse +> = { + id: 'sportmonks_football_get_seasons_by_team', + name: 'Get Seasons by Team', + description: 'Retrieve all seasons for a team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;stages)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/seasons/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_seasons_by_team') + } + return { + success: true, + output: { + seasons: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + seasons: { + type: 'array', + description: 'Array of season objects for the team', + items: { type: 'object', properties: SPORTMONKS_SEASON_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_stage.ts b/apps/sim/tools/sportmonks_football/get_stage.ts new file mode 100644 index 00000000000..f2ec0f9a4c6 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_stage.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STAGE_PROPERTIES, + type SportmonksStage, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStageParams extends SportmonksBaseParams { + stageId: string +} + +export interface SportmonksGetStageResponse extends ToolResponse { + output: { + stage: SportmonksStage | null + } +} + +export const sportmonksGetStageTool: ToolConfig< + SportmonksGetStageParams, + SportmonksGetStageResponse +> = { + id: 'sportmonks_football_get_stage', + name: 'Get Stage by ID', + description: 'Retrieve a single football stage by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stageId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the stage', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;rounds)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/stages/${encodeURIComponent(params.stageId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stage') + } + return { + success: true, + output: { + stage: data.data ?? null, + }, + } + }, + + outputs: { + stage: { + type: 'object', + description: 'The requested stage object', + properties: SPORTMONKS_STAGE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_stage_statistics.ts b/apps/sim/tools/sportmonks_football/get_stage_statistics.ts new file mode 100644 index 00000000000..d2ce43e3abc --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_stage_statistics.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STATISTIC_PROPERTIES, + type SportmonksStatistic, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStageStatisticsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + stageId: string +} + +export interface SportmonksGetStageStatisticsResponse extends ToolResponse { + output: { + statistics: SportmonksStatistic[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetStageStatisticsTool: ToolConfig< + SportmonksGetStageStatisticsParams, + SportmonksGetStageStatisticsResponse +> = { + id: 'sportmonks_football_get_stage_statistics', + name: 'Get Stage Statistics', + description: 'Retrieve all available statistics for a stage ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stageId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the stage', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participant)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. seasonstatisticTypes:52,88)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/statistics/stages/${encodeURIComponent(params.stageId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stage_statistics') + } + return { + success: true, + output: { + statistics: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + statistics: { + type: 'array', + description: 'Array of statistic entries for the stage', + items: { type: 'object', properties: SPORTMONKS_STATISTIC_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_stages.ts b/apps/sim/tools/sportmonks_football/get_stages.ts new file mode 100644 index 00000000000..05dbb99e31a --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_stages.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STAGE_PROPERTIES, + type SportmonksStage, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStagesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetStagesResponse extends ToolResponse { + output: { + stages: SportmonksStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetStagesTool: ToolConfig< + SportmonksGetStagesParams, + SportmonksGetStagesResponse +> = { + id: 'sportmonks_football_get_stages', + name: 'Get Stages', + description: 'Retrieve all football stages available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;rounds)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. stageSeasons:19735)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/stages`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stages') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage objects', + items: { type: 'object', properties: SPORTMONKS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_stages_by_season.ts b/apps/sim/tools/sportmonks_football/get_stages_by_season.ts new file mode 100644 index 00000000000..9e2005cf106 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_stages_by_season.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STAGE_PROPERTIES, + type SportmonksStage, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStagesBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetStagesBySeasonResponse extends ToolResponse { + output: { + stages: SportmonksStage[] + } +} + +export const sportmonksGetStagesBySeasonTool: ToolConfig< + SportmonksGetStagesBySeasonParams, + SportmonksGetStagesBySeasonResponse +> = { + id: 'sportmonks_football_get_stages_by_season', + name: 'Get Stages by Season', + description: 'Retrieve all stages for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;rounds)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/stages/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stages_by_season') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage objects for the season', + items: { type: 'object', properties: SPORTMONKS_STAGE_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_standing_corrections_by_season.ts b/apps/sim/tools/sportmonks_football/get_standing_corrections_by_season.ts new file mode 100644 index 00000000000..71144a542de --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_standing_corrections_by_season.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STANDING_CORRECTION_PROPERTIES, + type SportmonksStandingCorrection, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStandingCorrectionsBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetStandingCorrectionsBySeasonResponse extends ToolResponse { + output: { + corrections: SportmonksStandingCorrection[] + } +} + +export const sportmonksGetStandingCorrectionsBySeasonTool: ToolConfig< + SportmonksGetStandingCorrectionsBySeasonParams, + SportmonksGetStandingCorrectionsBySeasonResponse +> = { + id: 'sportmonks_football_get_standing_corrections_by_season', + name: 'Get Standing Corrections by Season', + description: 'Retrieve point corrections (awarded or deducted) for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participant;stage)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/standings/corrections/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_standing_corrections_by_season') + } + return { + success: true, + output: { + corrections: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + corrections: { + type: 'array', + description: 'Array of standing correction entries for the season', + items: { type: 'object', properties: SPORTMONKS_STANDING_CORRECTION_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_standings.ts b/apps/sim/tools/sportmonks_football/get_standings.ts new file mode 100644 index 00000000000..75c4bb46deb --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_standings.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STANDING_PROPERTIES, + type SportmonksStanding, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStandingsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetStandingsResponse extends ToolResponse { + output: { + standings: SportmonksStanding[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetStandingsTool: ToolConfig< + SportmonksGetStandingsParams, + SportmonksGetStandingsResponse +> = { + id: 'sportmonks_football_get_standings', + name: 'Get All Standings', + description: 'Retrieve all standings available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;league;season)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/standings`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_standings') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + standings: { + type: 'array', + description: 'Array of standing entries', + items: { type: 'object', properties: SPORTMONKS_STANDING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_standings_by_round.ts b/apps/sim/tools/sportmonks_football/get_standings_by_round.ts new file mode 100644 index 00000000000..d7014d123f1 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_standings_by_round.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STANDING_PROPERTIES, + type SportmonksStanding, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStandingsByRoundParams extends SportmonksBaseParams { + roundId: string +} + +export interface SportmonksGetStandingsByRoundResponse extends ToolResponse { + output: { + standings: SportmonksStanding[] + } +} + +export const sportmonksGetStandingsByRoundTool: ToolConfig< + SportmonksGetStandingsByRoundParams, + SportmonksGetStandingsByRoundResponse +> = { + id: 'sportmonks_football_get_standings_by_round', + name: 'Get Standings by Round', + description: 'Retrieve the full standing table for a round ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + roundId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the round', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. standingGroups:246697)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/standings/rounds/${encodeURIComponent(params.roundId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_standings_by_round') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + standings: { + type: 'array', + description: 'Array of standing entries for the round', + items: { type: 'object', properties: SPORTMONKS_STANDING_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_state.ts b/apps/sim/tools/sportmonks_football/get_state.ts new file mode 100644 index 00000000000..d2ae078f157 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_state.ts @@ -0,0 +1,77 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STATE_PROPERTIES, + type SportmonksState, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStateParams extends SportmonksBaseParams { + stateId: string +} + +export interface SportmonksGetStateResponse extends ToolResponse { + output: { + state: SportmonksState | null + } +} + +export const sportmonksGetStateTool: ToolConfig< + SportmonksGetStateParams, + SportmonksGetStateResponse +> = { + id: 'sportmonks_football_get_state', + name: 'Get State by ID', + description: 'Retrieve a single fixture state by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stateId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the state', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/states/${encodeURIComponent(params.stateId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_state') + } + return { + success: true, + output: { + state: data.data ?? null, + }, + } + }, + + outputs: { + state: { + type: 'object', + description: 'The requested fixture state object', + properties: SPORTMONKS_STATE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_states.ts b/apps/sim/tools/sportmonks_football/get_states.ts new file mode 100644 index 00000000000..e381ff4145e --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_states.ts @@ -0,0 +1,93 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STATE_PROPERTIES, + type SportmonksState, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetStatesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetStatesResponse extends ToolResponse { + output: { + states: SportmonksState[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetStatesTool: ToolConfig< + SportmonksGetStatesParams, + SportmonksGetStatesResponse +> = { + id: 'sportmonks_football_get_states', + name: 'Get States', + description: + 'Retrieve all fixture states (e.g. Not Started, 1st Half, Full Time) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/states`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_states') + } + return { + success: true, + output: { + states: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + states: { + type: 'array', + description: 'Array of fixture state objects', + items: { type: 'object', properties: SPORTMONKS_STATE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_team_rankings.ts b/apps/sim/tools/sportmonks_football/get_team_rankings.ts new file mode 100644 index 00000000000..9978a9fbf4f --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_team_rankings.ts @@ -0,0 +1,98 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_RANKING_PROPERTIES, + type SportmonksTeamRanking, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamRankingsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetTeamRankingsResponse extends ToolResponse { + output: { + teamRankings: SportmonksTeamRanking[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTeamRankingsTool: ToolConfig< + SportmonksGetTeamRankingsParams, + SportmonksGetTeamRankingsResponse +> = { + id: 'sportmonks_football_get_team_rankings', + name: 'Get All Team Rankings', + description: 'Retrieve all team rankings available within your Sportmonks subscription (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. team)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/team-rankings`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_team_rankings') + } + return { + success: true, + output: { + teamRankings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teamRankings: { + type: 'array', + description: 'Array of team ranking objects', + items: { type: 'object', properties: SPORTMONKS_TEAM_RANKING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_team_rankings_by_date.ts b/apps/sim/tools/sportmonks_football/get_team_rankings_by_date.ts new file mode 100644 index 00000000000..e536d9e4a07 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_team_rankings_by_date.ts @@ -0,0 +1,109 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_RANKING_PROPERTIES, + type SportmonksTeamRanking, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamRankingsByDateParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + date: string +} + +export interface SportmonksGetTeamRankingsByDateResponse extends ToolResponse { + output: { + teamRankings: SportmonksTeamRanking[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTeamRankingsByDateTool: ToolConfig< + SportmonksGetTeamRankingsByDateParams, + SportmonksGetTeamRankingsByDateResponse +> = { + id: 'sportmonks_football_get_team_rankings_by_date', + name: 'Get Team Rankings by Date', + description: 'Retrieve team rankings for a given date (YYYY-MM-DD) from Sportmonks (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + date: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The ranking date in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. team)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/team-rankings/date/${encodeURIComponent(params.date.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_team_rankings_by_date') + } + return { + success: true, + output: { + teamRankings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teamRankings: { + type: 'array', + description: 'Array of team ranking objects for the date', + items: { type: 'object', properties: SPORTMONKS_TEAM_RANKING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_team_rankings_by_team.ts b/apps/sim/tools/sportmonks_football/get_team_rankings_by_team.ts new file mode 100644 index 00000000000..545b8bace7a --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_team_rankings_by_team.ts @@ -0,0 +1,109 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_RANKING_PROPERTIES, + type SportmonksTeamRanking, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamRankingsByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetTeamRankingsByTeamResponse extends ToolResponse { + output: { + teamRankings: SportmonksTeamRanking[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTeamRankingsByTeamTool: ToolConfig< + SportmonksGetTeamRankingsByTeamParams, + SportmonksGetTeamRankingsByTeamResponse +> = { + id: 'sportmonks_football_get_team_rankings_by_team', + name: 'Get Team Rankings by Team', + description: 'Retrieve team rankings for a team ID from Sportmonks (beta)', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. team)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/team-rankings/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_team_rankings_by_team') + } + return { + success: true, + output: { + teamRankings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teamRankings: { + type: 'array', + description: 'Array of team ranking objects for the team', + items: { type: 'object', properties: SPORTMONKS_TEAM_RANKING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_team_squad_by_season.ts b/apps/sim/tools/sportmonks_football/get_team_squad_by_season.ts new file mode 100644 index 00000000000..0c71dba378b --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_team_squad_by_season.ts @@ -0,0 +1,98 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SQUAD_PROPERTIES, + type SportmonksSquadEntry, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamSquadBySeasonParams extends SportmonksBaseParams { + seasonId: string + teamId: string +} + +export interface SportmonksGetTeamSquadBySeasonResponse extends ToolResponse { + output: { + squad: SportmonksSquadEntry[] + } +} + +export const sportmonksGetTeamSquadBySeasonTool: ToolConfig< + SportmonksGetTeamSquadBySeasonParams, + SportmonksGetTeamSquadBySeasonResponse +> = { + id: 'sportmonks_football_get_team_squad_by_season', + name: 'Get Team Squad by Season', + description: 'Retrieve the (historical) squad for a team in a specific season from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. player;position)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/squads/seasons/${encodeURIComponent( + params.seasonId.trim() + )}/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_team_squad_by_season') + } + return { + success: true, + output: { + squad: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + squad: { + type: 'array', + description: 'Array of squad entries for the team in the season', + items: { type: 'object', properties: SPORTMONKS_SQUAD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_teams_by_country.ts b/apps/sim/tools/sportmonks_football/get_teams_by_country.ts new file mode 100644 index 00000000000..e91d1dfad46 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_teams_by_country.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_PROPERTIES, + type SportmonksTeam, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamsByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksGetTeamsByCountryResponse extends ToolResponse { + output: { + teams: SportmonksTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTeamsByCountryTool: ToolConfig< + SportmonksGetTeamsByCountryParams, + SportmonksGetTeamsByCountryResponse +> = { + id: 'sportmonks_football_get_teams_by_country', + name: 'Get Teams by Country', + description: 'Retrieve all teams for a country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;venue)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order teams by id (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/teams/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_teams_by_country') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team objects for the country', + items: { type: 'object', properties: SPORTMONKS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_teams_by_season.ts b/apps/sim/tools/sportmonks_football/get_teams_by_season.ts new file mode 100644 index 00000000000..cb967745c32 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_teams_by_season.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TEAM_PROPERTIES, + type SportmonksTeam, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTeamsBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksGetTeamsBySeasonResponse extends ToolResponse { + output: { + teams: SportmonksTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTeamsBySeasonTool: ToolConfig< + SportmonksGetTeamsBySeasonParams, + SportmonksGetTeamsBySeasonResponse +> = { + id: 'sportmonks_football_get_teams_by_season', + name: 'Get Teams by Season', + description: 'Retrieve all teams for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;venue)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order teams by id (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/teams/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_teams_by_season') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team objects for the season', + items: { type: 'object', properties: SPORTMONKS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_topscorers_by_stage.ts b/apps/sim/tools/sportmonks_football/get_topscorers_by_stage.ts new file mode 100644 index 00000000000..ac6269bafa3 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_topscorers_by_stage.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TOPSCORER_PROPERTIES, + type SportmonksTopscorer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTopscorersByStageParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + stageId: string +} + +export interface SportmonksGetTopscorersByStageResponse extends ToolResponse { + output: { + topscorers: SportmonksTopscorer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTopscorersByStageTool: ToolConfig< + SportmonksGetTopscorersByStageParams, + SportmonksGetTopscorersByStageResponse +> = { + id: 'sportmonks_football_get_topscorers_by_stage', + name: 'Get Topscorers by Stage', + description: 'Retrieve topscorers for a stage by stage ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stageId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the stage', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;participant;type)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. stageTopscorerTypes:208)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/topscorers/stages/${encodeURIComponent(params.stageId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_topscorers_by_stage') + } + return { + success: true, + output: { + topscorers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + topscorers: { + type: 'array', + description: 'Array of topscorer entries for the stage', + items: { type: 'object', properties: SPORTMONKS_TOPSCORER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_totw.ts b/apps/sim/tools/sportmonks_football/get_totw.ts new file mode 100644 index 00000000000..fba74e64640 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_totw.ts @@ -0,0 +1,96 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TOTW_PROPERTIES, + type SportmonksTotw, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTotwParams extends SportmonksBaseParams, SportmonksPaginationParams {} + +export interface SportmonksGetTotwResponse extends ToolResponse { + output: { + totw: SportmonksTotw[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTotwTool: ToolConfig = + { + id: 'sportmonks_football_get_totw', + name: 'Get All Team of the Week', + description: 'Retrieve all available Team of the Week (TOTW) entries from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fixture;team;player;round)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/team-of-the-week`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_totw') + } + return { + success: true, + output: { + totw: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + totw: { + type: 'array', + description: 'Array of Team of the Week entries', + items: { type: 'object', properties: SPORTMONKS_TOTW_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, + } diff --git a/apps/sim/tools/sportmonks_football/get_totw_by_round.ts b/apps/sim/tools/sportmonks_football/get_totw_by_round.ts new file mode 100644 index 00000000000..53d7b201b80 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_totw_by_round.ts @@ -0,0 +1,84 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TOTW_PROPERTIES, + type SportmonksTotw, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTotwByRoundParams extends SportmonksBaseParams { + roundId: string +} + +export interface SportmonksGetTotwByRoundResponse extends ToolResponse { + output: { + totw: SportmonksTotw[] + } +} + +export const sportmonksGetTotwByRoundTool: ToolConfig< + SportmonksGetTotwByRoundParams, + SportmonksGetTotwByRoundResponse +> = { + id: 'sportmonks_football_get_totw_by_round', + name: 'Get Team of the Week by Round', + description: 'Retrieve the Team of the Week (TOTW) for a round ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + roundId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the round', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fixture;team;player;round)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/team-of-the-week/rounds/${encodeURIComponent(params.roundId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_totw_by_round') + } + return { + success: true, + output: { + totw: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + totw: { + type: 'array', + description: 'Array of Team of the Week entries for the round', + items: { type: 'object', properties: SPORTMONKS_TOTW_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfer.ts b/apps/sim/tools/sportmonks_football/get_transfer.ts new file mode 100644 index 00000000000..a7c4e933dd4 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfer.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransferParams extends SportmonksBaseParams { + transferId: string +} + +export interface SportmonksGetTransferResponse extends ToolResponse { + output: { + transfer: SportmonksTransfer | null + } +} + +export const sportmonksGetTransferTool: ToolConfig< + SportmonksGetTransferParams, + SportmonksGetTransferResponse +> = { + id: 'sportmonks_football_get_transfer', + name: 'Get Transfer by ID', + description: 'Retrieve a single transfer by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + transferId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the transfer', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfers/${encodeURIComponent(params.transferId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfer') + } + return { + success: true, + output: { + transfer: data.data ?? null, + }, + } + }, + + outputs: { + transfer: { + type: 'object', + description: 'The requested transfer object', + properties: SPORTMONKS_TRANSFER_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfer_rumour.ts b/apps/sim/tools/sportmonks_football/get_transfer_rumour.ts new file mode 100644 index 00000000000..48c3f26b599 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfer_rumour.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + type SportmonksTransferRumour, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransferRumourParams extends SportmonksBaseParams { + rumourId: string +} + +export interface SportmonksGetTransferRumourResponse extends ToolResponse { + output: { + transferRumour: SportmonksTransferRumour | null + } +} + +export const sportmonksGetTransferRumourTool: ToolConfig< + SportmonksGetTransferRumourParams, + SportmonksGetTransferRumourResponse +> = { + id: 'sportmonks_football_get_transfer_rumour', + name: 'Get Transfer Rumour by ID', + description: 'Retrieve a single transfer rumour by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + rumourId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the transfer rumour', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfer-rumours/${encodeURIComponent(params.rumourId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfer_rumour') + } + return { + success: true, + output: { + transferRumour: data.data ?? null, + }, + } + }, + + outputs: { + transferRumour: { + type: 'object', + description: 'The requested transfer rumour object', + properties: SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfer_rumours_between_dates.ts b/apps/sim/tools/sportmonks_football/get_transfer_rumours_between_dates.ts new file mode 100644 index 00000000000..5375e5c54a5 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfer_rumours_between_dates.ts @@ -0,0 +1,125 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + type SportmonksTransferRumour, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransferRumoursBetweenDatesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + startDate: string + endDate: string +} + +export interface SportmonksGetTransferRumoursBetweenDatesResponse extends ToolResponse { + output: { + transferRumours: SportmonksTransferRumour[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransferRumoursBetweenDatesTool: ToolConfig< + SportmonksGetTransferRumoursBetweenDatesParams, + SportmonksGetTransferRumoursBetweenDatesResponse +> = { + id: 'sportmonks_football_get_transfer_rumours_between_dates', + name: 'Get Transfer Rumours Between Dates', + description: 'Retrieve transfer rumours within a date range (YYYY-MM-DD) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + startDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start date in YYYY-MM-DD format', + }, + endDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End date in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfer-rumours/between/${encodeURIComponent( + params.startDate.trim() + )}/${encodeURIComponent(params.endDate.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfer_rumours_between_dates') + } + return { + success: true, + output: { + transferRumours: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transferRumours: { + type: 'array', + description: 'Array of transfer rumour objects within the date range', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_player.ts b/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_player.ts new file mode 100644 index 00000000000..38aa22bd0b5 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_player.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + type SportmonksTransferRumour, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransferRumoursByPlayerParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + playerId: string +} + +export interface SportmonksGetTransferRumoursByPlayerResponse extends ToolResponse { + output: { + transferRumours: SportmonksTransferRumour[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransferRumoursByPlayerTool: ToolConfig< + SportmonksGetTransferRumoursByPlayerParams, + SportmonksGetTransferRumoursByPlayerResponse +> = { + id: 'sportmonks_football_get_transfer_rumours_by_player', + name: 'Get Transfer Rumours by Player', + description: 'Retrieve transfer rumours for a player ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + playerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the player', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfer-rumours/players/${encodeURIComponent(params.playerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfer_rumours_by_player') + } + return { + success: true, + output: { + transferRumours: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transferRumours: { + type: 'array', + description: 'Array of transfer rumour objects for the player', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_team.ts b/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_team.ts new file mode 100644 index 00000000000..6e18568638d --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfer_rumours_by_team.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES, + type SportmonksTransferRumour, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransferRumoursByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetTransferRumoursByTeamResponse extends ToolResponse { + output: { + transferRumours: SportmonksTransferRumour[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransferRumoursByTeamTool: ToolConfig< + SportmonksGetTransferRumoursByTeamParams, + SportmonksGetTransferRumoursByTeamResponse +> = { + id: 'sportmonks_football_get_transfer_rumours_by_team', + name: 'Get Transfer Rumours by Team', + description: 'Retrieve transfer rumours for a team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfer-rumours/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfer_rumours_by_team') + } + return { + success: true, + output: { + transferRumours: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transferRumours: { + type: 'array', + description: 'Array of transfer rumour objects for the team', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfers_between_dates.ts b/apps/sim/tools/sportmonks_football/get_transfers_between_dates.ts new file mode 100644 index 00000000000..f340a0232d4 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfers_between_dates.ts @@ -0,0 +1,125 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransfersBetweenDatesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + startDate: string + endDate: string +} + +export interface SportmonksGetTransfersBetweenDatesResponse extends ToolResponse { + output: { + transfers: SportmonksTransfer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransfersBetweenDatesTool: ToolConfig< + SportmonksGetTransfersBetweenDatesParams, + SportmonksGetTransfersBetweenDatesResponse +> = { + id: 'sportmonks_football_get_transfers_between_dates', + name: 'Get Transfers Between Dates', + description: 'Retrieve transfers within a date range (YYYY-MM-DD) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + startDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start date in YYYY-MM-DD format', + }, + endDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End date in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. transferTypes:219,220)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfers/between/${encodeURIComponent( + params.startDate.trim() + )}/${encodeURIComponent(params.endDate.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfers_between_dates') + } + return { + success: true, + output: { + transfers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transfers: { + type: 'array', + description: 'Array of transfer objects within the date range', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfers_by_player.ts b/apps/sim/tools/sportmonks_football/get_transfers_by_player.ts new file mode 100644 index 00000000000..80aef172eff --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfers_by_player.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransfersByPlayerParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + playerId: string +} + +export interface SportmonksGetTransfersByPlayerResponse extends ToolResponse { + output: { + transfers: SportmonksTransfer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransfersByPlayerTool: ToolConfig< + SportmonksGetTransfersByPlayerParams, + SportmonksGetTransfersByPlayerResponse +> = { + id: 'sportmonks_football_get_transfers_by_player', + name: 'Get Transfers by Player', + description: 'Retrieve transfers for a player by player ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + playerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the player', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. fromTeam;toTeam;type)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfers/players/${encodeURIComponent(params.playerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfers_by_player') + } + return { + success: true, + output: { + transfers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transfers: { + type: 'array', + description: 'Array of transfer objects for the player', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_transfers_by_team.ts b/apps/sim/tools/sportmonks_football/get_transfers_by_team.ts new file mode 100644 index 00000000000..313b4d42f92 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_transfers_by_team.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TRANSFER_PROPERTIES, + type SportmonksTransfer, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTransfersByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksGetTransfersByTeamResponse extends ToolResponse { + output: { + transfers: SportmonksTransfer[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTransfersByTeamTool: ToolConfig< + SportmonksGetTransfersByTeamParams, + SportmonksGetTransfersByTeamResponse +> = { + id: 'sportmonks_football_get_transfers_by_team', + name: 'Get Transfers by Team', + description: 'Retrieve transfers for a team by team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. player;fromTeam;toTeam)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. transferTypes:219,220)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/transfers/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_transfers_by_team') + } + return { + success: true, + output: { + transfers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + transfers: { + type: 'array', + description: 'Array of transfer objects for the team', + items: { type: 'object', properties: SPORTMONKS_TRANSFER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_tv_station.ts b/apps/sim/tools/sportmonks_football/get_tv_station.ts new file mode 100644 index 00000000000..a68c46cd5d8 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_tv_station.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TVSTATION_PROPERTIES, + type SportmonksTVStation, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTvStationParams extends SportmonksBaseParams { + tvStationId: string +} + +export interface SportmonksGetTvStationResponse extends ToolResponse { + output: { + tvStation: SportmonksTVStation | null + } +} + +export const sportmonksGetTvStationTool: ToolConfig< + SportmonksGetTvStationParams, + SportmonksGetTvStationResponse +> = { + id: 'sportmonks_football_get_tv_station', + name: 'Get TV Station by ID', + description: 'Retrieve a single TV station by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + tvStationId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the TV station', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/tv-stations/${encodeURIComponent(params.tvStationId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_tv_station') + } + return { + success: true, + output: { + tvStation: data.data ?? null, + }, + } + }, + + outputs: { + tvStation: { + type: 'object', + description: 'The requested TV station object', + properties: SPORTMONKS_TVSTATION_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_tv_stations.ts b/apps/sim/tools/sportmonks_football/get_tv_stations.ts new file mode 100644 index 00000000000..fa405de3a92 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_tv_stations.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TVSTATION_PROPERTIES, + type SportmonksTVStation, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTvStationsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetTvStationsResponse extends ToolResponse { + output: { + tvStations: SportmonksTVStation[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTvStationsTool: ToolConfig< + SportmonksGetTvStationsParams, + SportmonksGetTvStationsResponse +> = { + id: 'sportmonks_football_get_tv_stations', + name: 'Get TV Stations', + description: 'Retrieve all TV stations available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/tv-stations`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_tv_stations') + } + return { + success: true, + output: { + tvStations: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + tvStations: { + type: 'array', + description: 'Array of TV station objects', + items: { type: 'object', properties: SPORTMONKS_TVSTATION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_tv_stations_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_tv_stations_by_fixture.ts new file mode 100644 index 00000000000..024ebe66128 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_tv_stations_by_fixture.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_TVSTATION_PROPERTIES, + type SportmonksTVStation, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetTvStationsByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetTvStationsByFixtureResponse extends ToolResponse { + output: { + tvStations: SportmonksTVStation[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetTvStationsByFixtureTool: ToolConfig< + SportmonksGetTvStationsByFixtureParams, + SportmonksGetTvStationsByFixtureResponse +> = { + id: 'sportmonks_football_get_tv_stations_by_fixture', + name: 'Get TV Stations by Fixture', + description: 'Retrieve broadcasting TV stations for a fixture by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. fixtures;countries)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/tv-stations/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_tv_stations_by_fixture') + } + return { + success: true, + output: { + tvStations: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + tvStations: { + type: 'array', + description: 'Array of TV station objects broadcasting the fixture', + items: { type: 'object', properties: SPORTMONKS_TVSTATION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_market.ts b/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_market.ts new file mode 100644 index 00000000000..34a8bbcf47b --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_market.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetUpcomingFixturesByMarketParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + marketId: string +} + +export interface SportmonksGetUpcomingFixturesByMarketResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetUpcomingFixturesByMarketTool: ToolConfig< + SportmonksGetUpcomingFixturesByMarketParams, + SportmonksGetUpcomingFixturesByMarketResponse +> = { + id: 'sportmonks_football_get_upcoming_fixtures_by_market', + name: 'Get Upcoming Fixtures by Market', + description: 'Retrieve all upcoming fixtures for a market ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + marketId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the market', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participants;odds)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/upcoming/markets/${encodeURIComponent(params.marketId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_upcoming_fixtures_by_market') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of upcoming fixture objects for the market', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_tv_station.ts b/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_tv_station.ts new file mode 100644 index 00000000000..6c6197e32b9 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_upcoming_fixtures_by_tv_station.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetUpcomingFixturesByTvStationParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + tvStationId: string +} + +export interface SportmonksGetUpcomingFixturesByTvStationResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetUpcomingFixturesByTvStationTool: ToolConfig< + SportmonksGetUpcomingFixturesByTvStationParams, + SportmonksGetUpcomingFixturesByTvStationResponse +> = { + id: 'sportmonks_football_get_upcoming_fixtures_by_tv_station', + name: 'Get Upcoming Fixtures by TV Station', + description: 'Retrieve all upcoming fixtures available for a TV station ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + tvStationId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the TV station', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participants)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/upcoming/tv-stations/${encodeURIComponent(params.tvStationId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_upcoming_fixtures_by_tv_station') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of upcoming fixture objects for the TV station', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_value_bets.ts b/apps/sim/tools/sportmonks_football/get_value_bets.ts new file mode 100644 index 00000000000..1d888525516 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_value_bets.ts @@ -0,0 +1,99 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PREDICTION_PROPERTIES, + type SportmonksPrediction, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetValueBetsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetValueBetsResponse extends ToolResponse { + output: { + valueBets: SportmonksPrediction[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetValueBetsTool: ToolConfig< + SportmonksGetValueBetsParams, + SportmonksGetValueBetsResponse +> = { + id: 'sportmonks_football_get_value_bets', + name: 'Get Value Bets', + description: 'Retrieve all value bets available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/value-bets`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_value_bets') + } + return { + success: true, + output: { + valueBets: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + valueBets: { + type: 'array', + description: 'Array of value bet prediction objects', + items: { type: 'object', properties: SPORTMONKS_PREDICTION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_value_bets_by_fixture.ts b/apps/sim/tools/sportmonks_football/get_value_bets_by_fixture.ts new file mode 100644 index 00000000000..fc53e6f2764 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_value_bets_by_fixture.ts @@ -0,0 +1,109 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_PREDICTION_PROPERTIES, + type SportmonksPrediction, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetValueBetsByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetValueBetsByFixtureResponse extends ToolResponse { + output: { + valueBets: SportmonksPrediction[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetValueBetsByFixtureTool: ToolConfig< + SportmonksGetValueBetsByFixtureParams, + SportmonksGetValueBetsByFixtureResponse +> = { + id: 'sportmonks_football_get_value_bets_by_fixture', + name: 'Get Value Bets by Fixture', + description: 'Retrieve value bet predictions for a fixture by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. type;fixture)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/predictions/value-bets/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_value_bets_by_fixture') + } + return { + success: true, + output: { + valueBets: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + valueBets: { + type: 'array', + description: 'Array of value bet prediction entries for the fixture', + items: { type: 'object', properties: SPORTMONKS_PREDICTION_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_venue.ts b/apps/sim/tools/sportmonks_football/get_venue.ts new file mode 100644 index 00000000000..02bda7862ef --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_venue.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_VENUE_PROPERTIES, + type SportmonksVenue, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetVenueParams extends SportmonksBaseParams { + venueId: string +} + +export interface SportmonksGetVenueResponse extends ToolResponse { + output: { + venue: SportmonksVenue | null + } +} + +export const sportmonksGetVenueTool: ToolConfig< + SportmonksGetVenueParams, + SportmonksGetVenueResponse +> = { + id: 'sportmonks_football_get_venue', + name: 'Get Venue by ID', + description: 'Retrieve a single football venue by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + venueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the venue', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;city;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/venues/${encodeURIComponent(params.venueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venue') + } + return { + success: true, + output: { + venue: data.data ?? null, + }, + } + }, + + outputs: { + venue: { + type: 'object', + description: 'The requested venue object', + properties: SPORTMONKS_VENUE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_venues.ts b/apps/sim/tools/sportmonks_football/get_venues.ts new file mode 100644 index 00000000000..3e8466339b1 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_venues.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_VENUE_PROPERTIES, + type SportmonksVenue, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetVenuesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetVenuesResponse extends ToolResponse { + output: { + venues: SportmonksVenue[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksGetVenuesTool: ToolConfig< + SportmonksGetVenuesParams, + SportmonksGetVenuesResponse +> = { + id: 'sportmonks_football_get_venues', + name: 'Get Venues', + description: 'Retrieve all football venues available within your Sportmonks subscription', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. venueCountries:98)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_BASE_URL}/venues`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venues') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue objects', + items: { type: 'object', properties: SPORTMONKS_VENUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/get_venues_by_season.ts b/apps/sim/tools/sportmonks_football/get_venues_by_season.ts new file mode 100644 index 00000000000..b6fa4f875eb --- /dev/null +++ b/apps/sim/tools/sportmonks_football/get_venues_by_season.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_VENUE_PROPERTIES, + type SportmonksVenue, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetVenuesBySeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksGetVenuesBySeasonResponse extends ToolResponse { + output: { + venues: SportmonksVenue[] + } +} + +export const sportmonksGetVenuesBySeasonTool: ToolConfig< + SportmonksGetVenuesBySeasonParams, + SportmonksGetVenuesBySeasonResponse +> = { + id: 'sportmonks_football_get_venues_by_season', + name: 'Get Venues by Season', + description: 'Retrieve all venues for a season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/venues/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venues_by_season') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue objects for the season', + items: { type: 'object', properties: SPORTMONKS_VENUE_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_football/index.ts b/apps/sim/tools/sportmonks_football/index.ts index 1b07764325d..1fe0bba775f 100644 --- a/apps/sim/tools/sportmonks_football/index.ts +++ b/apps/sim/tools/sportmonks_football/index.ts @@ -1,15 +1,122 @@ +export { sportmonksExpectedByPlayerTool } from './expected_by_player' +export { sportmonksExpectedByTeamTool } from './expected_by_team' +export { sportmonksGetAllCommentariesTool } from './get_all_commentaries' +export { sportmonksGetAllFixturesTool } from './get_all_fixtures' +export { sportmonksGetAllPlayersTool } from './get_all_players' +export { sportmonksGetAllRivalsTool } from './get_all_rivals' +export { sportmonksGetAllTeamsTool } from './get_all_teams' +export { sportmonksGetAllTransferRumoursTool } from './get_all_transfer_rumours' +export { sportmonksGetAllTransfersTool } from './get_all_transfers' +export { sportmonksGetBracketsBySeasonTool } from './get_brackets_by_season' +export { sportmonksGetCoachTool } from './get_coach' +export { sportmonksGetCoachesTool } from './get_coaches' +export { sportmonksGetCoachesByCountryTool } from './get_coaches_by_country' +export { sportmonksGetCommentariesByFixtureTool } from './get_commentaries_by_fixture' +export { sportmonksGetCurrentLeaguesByTeamTool } from './get_current_leagues_by_team' +export { sportmonksGetExpectedLineupsByPlayerTool } from './get_expected_lineups_by_player' +export { sportmonksGetExpectedLineupsByTeamTool } from './get_expected_lineups_by_team' +export { sportmonksGetExtendedTeamSquadTool } from './get_extended_team_squad' export { sportmonksGetFixtureTool } from './get_fixture' export { sportmonksGetFixturesByDateTool } from './get_fixtures_by_date' export { sportmonksGetFixturesByDateRangeTool } from './get_fixtures_by_date_range' +export { sportmonksGetFixturesByDateRangeForTeamTool } from './get_fixtures_by_date_range_for_team' +export { sportmonksGetFixturesByIdsTool } from './get_fixtures_by_ids' +export { sportmonksGetGroupedStandingsByRoundTool } from './get_grouped_standings_by_round' export { sportmonksGetHeadToHeadTool } from './get_head_to_head' export { sportmonksGetInplayLivescoresTool } from './get_inplay_livescores' +export { sportmonksGetLatestCoachesTool } from './get_latest_coaches' +export { sportmonksGetLatestFixturesTool } from './get_latest_fixtures' +export { sportmonksGetLatestLivescoresTool } from './get_latest_livescores' +export { sportmonksGetLatestPlayersTool } from './get_latest_players' +export { sportmonksGetLatestTotwTool } from './get_latest_totw' +export { sportmonksGetLatestTransfersTool } from './get_latest_transfers' export { sportmonksGetLeagueTool } from './get_league' export { sportmonksGetLeaguesTool } from './get_leagues' +export { sportmonksGetLeaguesByCountryTool } from './get_leagues_by_country' +export { sportmonksGetLeaguesByDateTool } from './get_leagues_by_date' +export { sportmonksGetLeaguesByTeamTool } from './get_leagues_by_team' +export { sportmonksGetLiveLeaguesTool } from './get_live_leagues' +export { sportmonksGetLiveProbabilitiesTool } from './get_live_probabilities' +export { sportmonksGetLiveProbabilitiesByFixtureTool } from './get_live_probabilities_by_fixture' +export { sportmonksGetLiveStandingsByLeagueTool } from './get_live_standings_by_league' export { sportmonksGetLivescoresTool } from './get_livescores' +export { sportmonksGetMatchFactsTool } from './get_match_facts' +export { sportmonksGetMatchFactsByDateRangeTool } from './get_match_facts_by_date_range' +export { sportmonksGetMatchFactsByFixtureTool } from './get_match_facts_by_fixture' +export { sportmonksGetMatchFactsByLeagueTool } from './get_match_facts_by_league' +export { sportmonksGetPastFixturesByTvStationTool } from './get_past_fixtures_by_tv_station' export { sportmonksGetPlayerTool } from './get_player' +export { sportmonksGetPlayersByCountryTool } from './get_players_by_country' +export { sportmonksGetPostmatchNewsTool } from './get_postmatch_news' +export { sportmonksGetPostmatchNewsBySeasonTool } from './get_postmatch_news_by_season' +export { sportmonksGetPredictabilityByLeagueTool } from './get_predictability_by_league' +export { sportmonksGetPrematchNewsTool } from './get_prematch_news' +export { sportmonksGetPrematchNewsBySeasonTool } from './get_prematch_news_by_season' +export { sportmonksGetPrematchNewsUpcomingTool } from './get_prematch_news_upcoming' +export { sportmonksGetProbabilitiesTool } from './get_probabilities' +export { sportmonksGetProbabilitiesByFixtureTool } from './get_probabilities_by_fixture' +export { sportmonksGetRefereeTool } from './get_referee' +export { sportmonksGetRefereesTool } from './get_referees' +export { sportmonksGetRefereesByCountryTool } from './get_referees_by_country' +export { sportmonksGetRefereesBySeasonTool } from './get_referees_by_season' +export { sportmonksGetRivalsByTeamTool } from './get_rivals_by_team' +export { sportmonksGetRoundTool } from './get_round' +export { sportmonksGetRoundStatisticsTool } from './get_round_statistics' +export { sportmonksGetRoundsTool } from './get_rounds' +export { sportmonksGetRoundsBySeasonTool } from './get_rounds_by_season' +export { sportmonksGetSchedulesBySeasonTool } from './get_schedules_by_season' +export { sportmonksGetSchedulesBySeasonAndTeamTool } from './get_schedules_by_season_and_team' +export { sportmonksGetSchedulesByTeamTool } from './get_schedules_by_team' +export { sportmonksGetSeasonTool } from './get_season' +export { sportmonksGetSeasonsTool } from './get_seasons' +export { sportmonksGetSeasonsByTeamTool } from './get_seasons_by_team' +export { sportmonksGetStageTool } from './get_stage' +export { sportmonksGetStageStatisticsTool } from './get_stage_statistics' +export { sportmonksGetStagesTool } from './get_stages' +export { sportmonksGetStagesBySeasonTool } from './get_stages_by_season' +export { sportmonksGetStandingCorrectionsBySeasonTool } from './get_standing_corrections_by_season' +export { sportmonksGetStandingsTool } from './get_standings' +export { sportmonksGetStandingsByRoundTool } from './get_standings_by_round' export { sportmonksGetStandingsBySeasonTool } from './get_standings_by_season' +export { sportmonksGetStateTool } from './get_state' +export { sportmonksGetStatesTool } from './get_states' export { sportmonksGetTeamTool } from './get_team' +export { sportmonksGetTeamRankingsTool } from './get_team_rankings' +export { sportmonksGetTeamRankingsByDateTool } from './get_team_rankings_by_date' +export { sportmonksGetTeamRankingsByTeamTool } from './get_team_rankings_by_team' export { sportmonksGetTeamSquadTool } from './get_team_squad' +export { sportmonksGetTeamSquadBySeasonTool } from './get_team_squad_by_season' +export { sportmonksGetTeamsByCountryTool } from './get_teams_by_country' +export { sportmonksGetTeamsBySeasonTool } from './get_teams_by_season' export { sportmonksGetTopscorersBySeasonTool } from './get_topscorers_by_season' +export { sportmonksGetTopscorersByStageTool } from './get_topscorers_by_stage' +export { sportmonksGetTotwTool } from './get_totw' +export { sportmonksGetTotwByRoundTool } from './get_totw_by_round' +export { sportmonksGetTransferTool } from './get_transfer' +export { sportmonksGetTransferRumourTool } from './get_transfer_rumour' +export { sportmonksGetTransferRumoursBetweenDatesTool } from './get_transfer_rumours_between_dates' +export { sportmonksGetTransferRumoursByPlayerTool } from './get_transfer_rumours_by_player' +export { sportmonksGetTransferRumoursByTeamTool } from './get_transfer_rumours_by_team' +export { sportmonksGetTransfersBetweenDatesTool } from './get_transfers_between_dates' +export { sportmonksGetTransfersByPlayerTool } from './get_transfers_by_player' +export { sportmonksGetTransfersByTeamTool } from './get_transfers_by_team' +export { sportmonksGetTvStationTool } from './get_tv_station' +export { sportmonksGetTvStationsTool } from './get_tv_stations' +export { sportmonksGetTvStationsByFixtureTool } from './get_tv_stations_by_fixture' +export { sportmonksGetUpcomingFixturesByMarketTool } from './get_upcoming_fixtures_by_market' +export { sportmonksGetUpcomingFixturesByTvStationTool } from './get_upcoming_fixtures_by_tv_station' +export { sportmonksGetValueBetsTool } from './get_value_bets' +export { sportmonksGetValueBetsByFixtureTool } from './get_value_bets_by_fixture' +export { sportmonksGetVenueTool } from './get_venue' +export { sportmonksGetVenuesTool } from './get_venues' +export { sportmonksGetVenuesBySeasonTool } from './get_venues_by_season' +export { sportmonksSearchCoachesTool } from './search_coaches' +export { sportmonksSearchFixturesTool } from './search_fixtures' +export { sportmonksSearchLeaguesTool } from './search_leagues' export { sportmonksSearchPlayersTool } from './search_players' +export { sportmonksSearchRefereesTool } from './search_referees' +export { sportmonksSearchRoundsTool } from './search_rounds' +export { sportmonksSearchSeasonsTool } from './search_seasons' +export { sportmonksSearchStagesTool } from './search_stages' export { sportmonksSearchTeamsTool } from './search_teams' +export { sportmonksSearchVenuesTool } from './search_venues' diff --git a/apps/sim/tools/sportmonks_football/search_coaches.ts b/apps/sim/tools/sportmonks_football/search_coaches.ts new file mode 100644 index 00000000000..d1453797314 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_coaches.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_COACH_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksCoach, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchCoachesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchCoachesResponse extends ToolResponse { + output: { + coaches: SportmonksCoach[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchCoachesTool: ToolConfig< + SportmonksSearchCoachesParams, + SportmonksSearchCoachesResponse +> = { + id: 'sportmonks_football_search_coaches', + name: 'Search Coaches', + description: 'Search for football coaches by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The coach name to search for (e.g. Gerrard)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/coaches/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_coaches') + } + return { + success: true, + output: { + coaches: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + coaches: { + type: 'array', + description: 'Array of coach objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_COACH_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_fixtures.ts b/apps/sim/tools/sportmonks_football/search_fixtures.ts new file mode 100644 index 00000000000..287dd254eee --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_fixtures.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FIXTURE_PROPERTIES, + SPORTMONKS_FOOTBALL_BASE_URL, + type SportmonksFixture, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchFixturesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchFixturesResponse extends ToolResponse { + output: { + fixtures: SportmonksFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchFixturesTool: ToolConfig< + SportmonksSearchFixturesParams, + SportmonksSearchFixturesResponse +> = { + id: 'sportmonks_football_search_fixtures', + name: 'Search Fixtures', + description: 'Search for football fixtures by name (participants) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The fixture name to search for (e.g. Celtic)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;scores)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. fixtureLeagues:501)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order fixtures by starting_at (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/fixtures/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_fixtures') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of fixture objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_leagues.ts b/apps/sim/tools/sportmonks_football/search_leagues.ts new file mode 100644 index 00000000000..908159d87aa --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_leagues.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_LEAGUE_PROPERTIES, + type SportmonksLeague, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchLeaguesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchLeaguesResponse extends ToolResponse { + output: { + leagues: SportmonksLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchLeaguesTool: ToolConfig< + SportmonksSearchLeaguesParams, + SportmonksSearchLeaguesResponse +> = { + id: 'sportmonks_football_search_leagues', + name: 'Search Leagues', + description: 'Search for football leagues by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The league name to search for (e.g. Premier)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. country;currentSeason)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order leagues (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/leagues/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_leagues') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_referees.ts b/apps/sim/tools/sportmonks_football/search_referees.ts new file mode 100644 index 00000000000..1e2545dcb9c --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_referees.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_REFEREE_PROPERTIES, + type SportmonksReferee, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchRefereesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchRefereesResponse extends ToolResponse { + output: { + referees: SportmonksReferee[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchRefereesTool: ToolConfig< + SportmonksSearchRefereesParams, + SportmonksSearchRefereesResponse +> = { + id: 'sportmonks_football_search_referees', + name: 'Search Referees', + description: 'Search for football referees by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The referee name to search for', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/referees/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_referees') + } + return { + success: true, + output: { + referees: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + referees: { + type: 'array', + description: 'Array of referee objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_REFEREE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_rounds.ts b/apps/sim/tools/sportmonks_football/search_rounds.ts new file mode 100644 index 00000000000..35435ea752a --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_rounds.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_ROUND_PROPERTIES, + type SportmonksRound, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchRoundsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchRoundsResponse extends ToolResponse { + output: { + rounds: SportmonksRound[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchRoundsTool: ToolConfig< + SportmonksSearchRoundsParams, + SportmonksSearchRoundsResponse +> = { + id: 'sportmonks_football_search_rounds', + name: 'Search Rounds', + description: 'Search for football rounds by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The round name to search for (e.g. 5)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;season)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/rounds/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_rounds') + } + return { + success: true, + output: { + rounds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + rounds: { + type: 'array', + description: 'Array of round objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_ROUND_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_seasons.ts b/apps/sim/tools/sportmonks_football/search_seasons.ts new file mode 100644 index 00000000000..72201dd94d3 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_seasons.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_SEASON_PROPERTIES, + type SportmonksSeason, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchSeasonsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchSeasonsResponse extends ToolResponse { + output: { + seasons: SportmonksSeason[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchSeasonsTool: ToolConfig< + SportmonksSearchSeasonsParams, + SportmonksSearchSeasonsResponse +> = { + id: 'sportmonks_football_search_seasons', + name: 'Search Seasons', + description: 'Search for football seasons by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The season name to search for (e.g. 2023/2024)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/seasons/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_seasons') + } + return { + success: true, + output: { + seasons: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + seasons: { + type: 'array', + description: 'Array of season objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_SEASON_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_stages.ts b/apps/sim/tools/sportmonks_football/search_stages.ts new file mode 100644 index 00000000000..af7d78fa74f --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_stages.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_STAGE_PROPERTIES, + type SportmonksStage, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchStagesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchStagesResponse extends ToolResponse { + output: { + stages: SportmonksStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchStagesTool: ToolConfig< + SportmonksSearchStagesParams, + SportmonksSearchStagesResponse +> = { + id: 'sportmonks_football_search_stages', + name: 'Search Stages', + description: 'Search for football stages by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The stage name to search for (e.g. Group)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;season)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/stages/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_stages') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/search_venues.ts b/apps/sim/tools/sportmonks_football/search_venues.ts new file mode 100644 index 00000000000..24f9d7f8577 --- /dev/null +++ b/apps/sim/tools/sportmonks_football/search_venues.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_BASE_URL, + SPORTMONKS_VENUE_PROPERTIES, + type SportmonksVenue, +} from '@/tools/sportmonks_football/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksSearchVenuesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksSearchVenuesResponse extends ToolResponse { + output: { + venues: SportmonksVenue[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksSearchVenuesTool: ToolConfig< + SportmonksSearchVenuesParams, + SportmonksSearchVenuesResponse +> = { + id: 'sportmonks_football_search_venues', + name: 'Search Venues', + description: 'Search for football venues by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The venue name to search for (e.g. Celtic Park)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_BASE_URL}/venues/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_venues') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_VENUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_football/types.ts b/apps/sim/tools/sportmonks_football/types.ts index 47343ec28f4..1c36b8797d1 100644 --- a/apps/sim/tools/sportmonks_football/types.ts +++ b/apps/sim/tools/sportmonks_football/types.ts @@ -223,7 +223,11 @@ export const SPORTMONKS_STANDING_PROPERTIES = { */ export const SPORTMONKS_TOPSCORER_PROPERTIES = { id: { type: 'number', description: 'Unique id of the topscorer record' }, - season_id: { type: 'number', description: 'Season related to the topscorer' }, + season_id: { + type: 'number', + description: 'Season related to the topscorer (absent on stage topscorers)', + optional: true, + }, league_id: { type: 'number', description: 'League related to the topscorer', optional: true }, stage_id: { type: 'number', description: 'Stage related to the topscorer', optional: true }, player_id: { type: 'number', description: 'Player related to the topscorer' }, @@ -369,7 +373,7 @@ export interface SportmonksStanding { export interface SportmonksTopscorer { id: number - season_id: number + season_id?: number league_id?: number stage_id?: number player_id: number @@ -390,3 +394,955 @@ export interface SportmonksSquadEntry { start?: string | null end?: string | null } + +/** + * Output property definitions for a Season object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/league-season-schedule-stage-and-round + */ +export const SPORTMONKS_SEASON_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the season' }, + sport_id: { type: 'number', description: 'Sport of the season' }, + league_id: { type: 'number', description: 'League of the season' }, + tie_breaker_rule_id: { + type: 'number', + description: 'Tie-breaker rule of the season', + nullable: true, + optional: true, + }, + name: { type: 'string', description: 'Name of the season (e.g. 2023/2024)' }, + finished: { type: 'boolean', description: 'Whether the season is finished', optional: true }, + pending: { type: 'boolean', description: 'Whether the season is pending', optional: true }, + is_current: { + type: 'boolean', + description: 'Whether the season is the current season', + optional: true, + }, + standing_method: { + type: 'string', + description: 'Standing calculation method', + nullable: true, + optional: true, + }, + starting_at: { + type: 'string', + description: 'Start date of the season', + nullable: true, + optional: true, + }, + ending_at: { + type: 'string', + description: 'End date of the season', + nullable: true, + optional: true, + }, + standings_recalculated_at: { + type: 'string', + description: 'Last standings recalculation time', + nullable: true, + optional: true, + }, + games_in_current_week: { + type: 'boolean', + description: 'Whether the season has fixtures this week', + optional: true, + }, +} as const satisfies Record + +/** Output property definitions for a Stage object. */ +export const SPORTMONKS_STAGE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the stage' }, + sport_id: { type: 'number', description: 'Sport of the stage' }, + league_id: { type: 'number', description: 'League of the stage' }, + season_id: { type: 'number', description: 'Season of the stage' }, + type_id: { type: 'number', description: 'Type of the stage' }, + name: { type: 'string', description: 'Name of the stage' }, + sort_order: { type: 'number', description: 'Sort order of the stage', optional: true }, + finished: { type: 'boolean', description: 'Whether the stage is finished', optional: true }, + is_current: { + type: 'boolean', + description: 'Whether the stage is the current stage', + optional: true, + }, + starting_at: { + type: 'string', + description: 'Start date of the stage', + nullable: true, + optional: true, + }, + ending_at: { + type: 'string', + description: 'End date of the stage', + nullable: true, + optional: true, + }, + games_in_current_week: { + type: 'boolean', + description: 'Whether the stage has fixtures this week', + optional: true, + }, +} as const satisfies Record + +/** Output property definitions for a Round object. */ +export const SPORTMONKS_ROUND_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the round' }, + sport_id: { type: 'number', description: 'Sport of the round' }, + league_id: { type: 'number', description: 'League of the round' }, + season_id: { type: 'number', description: 'Season of the round' }, + stage_id: { type: 'number', description: 'Stage of the round', nullable: true, optional: true }, + name: { type: 'string', description: 'Name of the round' }, + finished: { type: 'boolean', description: 'Whether the round is finished', optional: true }, + is_current: { + type: 'boolean', + description: 'Whether the round is the current round', + optional: true, + }, + starting_at: { + type: 'string', + description: 'Start date of the round', + nullable: true, + optional: true, + }, + ending_at: { + type: 'string', + description: 'End date of the round', + nullable: true, + optional: true, + }, + games_in_current_week: { + type: 'boolean', + description: 'Whether the round has fixtures this week', + optional: true, + }, +} as const satisfies Record + +/** Output property definitions for a Coach object. */ +export const SPORTMONKS_COACH_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the coach' }, + player_id: { + type: 'number', + description: 'Player related to the coach', + nullable: true, + optional: true, + }, + sport_id: { type: 'number', description: 'Sport of the coach' }, + country_id: { type: 'number', description: 'Country of the coach', nullable: true }, + nationality_id: { type: 'number', description: 'Nationality of the coach', nullable: true }, + city_id: { + type: 'number', + description: 'Birth city of the coach', + nullable: true, + optional: true, + }, + common_name: { type: 'string', description: 'Common name of the coach', optional: true }, + firstname: { + type: 'string', + description: 'First name of the coach', + nullable: true, + optional: true, + }, + lastname: { + type: 'string', + description: 'Last name of the coach', + nullable: true, + optional: true, + }, + name: { type: 'string', description: 'Name of the coach' }, + display_name: { type: 'string', description: 'Display name of the coach', optional: true }, + image_path: { type: 'string', description: 'URL to the coach headshot', optional: true }, + height: { + type: 'number', + description: 'Height of the coach in cm', + nullable: true, + optional: true, + }, + weight: { + type: 'number', + description: 'Weight of the coach in kg', + nullable: true, + optional: true, + }, + date_of_birth: { + type: 'string', + description: 'Date of birth of the coach', + nullable: true, + optional: true, + }, + gender: { type: 'string', description: 'Gender of the coach', nullable: true, optional: true }, +} as const satisfies Record + +/** Output property definitions for a Referee object. */ +export const SPORTMONKS_REFEREE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the referee' }, + sport_id: { type: 'number', description: 'Sport of the referee' }, + country_id: { type: 'number', description: 'Country of the referee', nullable: true }, + nationality_id: { + type: 'number', + description: 'Nationality of the referee', + nullable: true, + optional: true, + }, + city_id: { + type: 'number', + description: 'Birth city of the referee', + nullable: true, + optional: true, + }, + common_name: { type: 'string', description: 'Common name of the referee', optional: true }, + firstname: { + type: 'string', + description: 'First name of the referee', + nullable: true, + optional: true, + }, + lastname: { + type: 'string', + description: 'Last name of the referee', + nullable: true, + optional: true, + }, + name: { type: 'string', description: 'Name of the referee' }, + display_name: { type: 'string', description: 'Display name of the referee', optional: true }, + image_path: { type: 'string', description: 'URL to the referee headshot', optional: true }, + height: { + type: 'number', + description: 'Height of the referee in cm', + nullable: true, + optional: true, + }, + weight: { + type: 'number', + description: 'Weight of the referee in kg', + nullable: true, + optional: true, + }, + date_of_birth: { + type: 'string', + description: 'Date of birth of the referee', + nullable: true, + optional: true, + }, + gender: { type: 'string', description: 'Gender of the referee', nullable: true, optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a Venue object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_VENUE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the venue' }, + country_id: { type: 'number', description: 'Country of the venue', nullable: true }, + city_id: { type: 'number', description: 'City of the venue', nullable: true, optional: true }, + name: { type: 'string', description: 'Name of the venue' }, + address: { type: 'string', description: 'Address of the venue', nullable: true, optional: true }, + zipcode: { type: 'string', description: 'Zipcode of the venue', nullable: true, optional: true }, + latitude: { + type: 'string', + description: 'Latitude of the venue', + nullable: true, + optional: true, + }, + longitude: { + type: 'string', + description: 'Longitude of the venue', + nullable: true, + optional: true, + }, + capacity: { + type: 'number', + description: 'Seating capacity of the venue', + nullable: true, + optional: true, + }, + image_path: { + type: 'string', + description: 'Image path of the venue', + nullable: true, + optional: true, + }, + city_name: { + type: 'string', + description: 'Name of the city the venue is in', + nullable: true, + optional: true, + }, + surface: { + type: 'string', + description: 'Surface type of the venue', + nullable: true, + optional: true, + }, + national_team: { + type: 'boolean', + description: 'Whether the venue is used by the national team', + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a State object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_STATE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the state' }, + state: { type: 'string', description: 'State code (e.g. NS, INPLAY_1ST_HALF)' }, + name: { type: 'string', description: 'Full name of the state (e.g. Not Started)' }, + short_name: { + type: 'string', + description: 'Short name of the state (e.g. NS)', + nullable: true, + optional: true, + }, + developer_name: { type: 'string', description: 'Developer name of the state', optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a Transfer object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_TRANSFER_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the transfer' }, + sport_id: { type: 'number', description: 'Sport of the transfer' }, + player_id: { type: 'number', description: 'Player who transferred' }, + type_id: { type: 'number', description: 'Type of the transfer' }, + from_team_id: { type: 'number', description: 'Team the player transferred from', nullable: true }, + to_team_id: { type: 'number', description: 'Team the player transferred to', nullable: true }, + position_id: { + type: 'number', + description: 'Position id of the transfer', + nullable: true, + optional: true, + }, + detailed_position_id: { + type: 'number', + description: 'Detailed position id of the transfer', + nullable: true, + optional: true, + }, + date: { type: 'string', description: 'Date of the transfer', nullable: true }, + career_ended: { + type: 'boolean', + description: 'Whether the transfer ended the career', + optional: true, + }, + completed: { type: 'boolean', description: 'Whether the transfer is completed', optional: true }, + amount: { type: 'number', description: 'Transfer fee amount', nullable: true, optional: true }, +} as const satisfies Record + +/** + * Output property definitions for an Expected (xG) by-team value. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/expected + */ +export const SPORTMONKS_EXPECTED_TEAM_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the expected value' }, + fixture_id: { type: 'number', description: 'Fixture related to the value' }, + type_id: { type: 'number', description: 'Type of the expected value' }, + participant_id: { type: 'number', description: 'Team related to the expected value' }, + data: { + type: 'object', + description: 'The expected value payload', + properties: { value: { type: 'number', description: 'The xG value' } }, + }, + location: { type: 'string', description: 'Home or away', nullable: true, optional: true }, +} as const satisfies Record + +/** Output property definitions for an Expected (xG) by-player value. */ +export const SPORTMONKS_EXPECTED_PLAYER_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the expected value' }, + fixture_id: { type: 'number', description: 'Fixture related to the value' }, + player_id: { type: 'number', description: 'Player related to the value' }, + team_id: { + type: 'number', + description: 'Team related to the value', + nullable: true, + optional: true, + }, + lineup_id: { + type: 'number', + description: 'Lineup record the player relates to', + nullable: true, + optional: true, + }, + type_id: { type: 'number', description: 'Type of the expected value' }, + data: { + type: 'object', + description: 'The expected value payload', + properties: { value: { type: 'number', description: 'The xG value' } }, + }, +} as const satisfies Record + +/** + * Output property definitions for a Prediction / Value Bet object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/odd-and-prediction + */ +export const SPORTMONKS_PREDICTION_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the prediction' }, + fixture_id: { type: 'number', description: 'Fixture related to the prediction' }, + predictions: { + type: 'json', + description: 'Prediction payload (varies by type: score map, value bet object, etc.)', + }, + type_id: { type: 'number', description: 'Type of the prediction' }, +} as const satisfies Record + +/** + * Output property definitions for a Commentary object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_COMMENTARY_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the commentary' }, + fixture_id: { type: 'number', description: 'Fixture related to the commentary' }, + comment: { type: 'string', description: 'The commentary text' }, + minute: { + type: 'number', + description: 'Match minute of the comment', + nullable: true, + optional: true, + }, + extra_minute: { + type: 'number', + description: 'Extra (injury) minute of the comment', + nullable: true, + optional: true, + }, + is_goal: { type: 'boolean', description: 'Whether the comment is a goal', optional: true }, + is_important: { + type: 'boolean', + description: 'Whether the comment is important', + optional: true, + }, + order: { type: 'number', description: 'Order of the comment', optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a TV Station object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_TVSTATION_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the TV station' }, + name: { type: 'string', description: 'Name of the TV station' }, + url: { type: 'string', description: 'URL of the TV station', nullable: true, optional: true }, + image_path: { + type: 'string', + description: 'Image path of the TV station', + nullable: true, + optional: true, + }, + type: { type: 'string', description: 'Type of the TV station (tv, channel)', optional: true }, + related_id: { + type: 'number', + description: 'Related id of the TV station', + nullable: true, + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Rival object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_RIVAL_PROPERTIES = { + sport_id: { type: 'number', description: 'Sport of the rival' }, + team_id: { type: 'number', description: 'Team the rivalry belongs to' }, + rival_id: { type: 'number', description: 'Rival team id' }, +} as const satisfies Record + +export interface SportmonksSeason { + id: number + sport_id: number + league_id: number + tie_breaker_rule_id?: number | null + name: string + finished?: boolean + pending?: boolean + is_current?: boolean + standing_method?: string | null + starting_at?: string | null + ending_at?: string | null + standings_recalculated_at?: string | null + games_in_current_week?: boolean +} + +export interface SportmonksStage { + id: number + sport_id: number + league_id: number + season_id: number + type_id: number + name: string + sort_order?: number + finished?: boolean + is_current?: boolean + starting_at?: string | null + ending_at?: string | null + games_in_current_week?: boolean +} + +export interface SportmonksRound { + id: number + sport_id: number + league_id: number + season_id: number + stage_id?: number | null + name: string + finished?: boolean + is_current?: boolean + starting_at?: string | null + ending_at?: string | null + games_in_current_week?: boolean +} + +export interface SportmonksCoach { + id: number + player_id?: number | null + sport_id: number + country_id: number | null + nationality_id: number | null + city_id?: number | null + common_name?: string + firstname?: string | null + lastname?: string | null + name: string + display_name?: string + image_path?: string + height?: number | null + weight?: number | null + date_of_birth?: string | null + gender?: string | null +} + +export interface SportmonksReferee { + id: number + sport_id: number + country_id: number | null + nationality_id?: number | null + city_id?: number | null + common_name?: string + firstname?: string | null + lastname?: string | null + name: string + display_name?: string + image_path?: string + height?: number | null + weight?: number | null + date_of_birth?: string | null + gender?: string | null +} + +export interface SportmonksVenue { + id: number + country_id: number | null + city_id?: number | null + name: string + address?: string | null + zipcode?: string | null + latitude?: string | null + longitude?: string | null + capacity?: number | null + image_path?: string | null + city_name?: string | null + surface?: string | null + national_team?: boolean +} + +export interface SportmonksState { + id: number + state: string + name: string + short_name?: string | null + developer_name?: string +} + +export interface SportmonksTransfer { + id: number + sport_id: number + player_id: number + type_id: number + from_team_id: number | null + to_team_id: number | null + position_id?: number | null + detailed_position_id?: number | null + date: string | null + career_ended?: boolean + completed?: boolean + amount?: number | null +} + +export interface SportmonksExpectedTeam { + id: number + fixture_id: number + type_id: number + participant_id: number + data: { value: number } + location?: string | null +} + +export interface SportmonksExpectedPlayer { + id: number + fixture_id: number + player_id: number + team_id?: number | null + lineup_id?: number | null + type_id: number + data: { value: number } +} + +export interface SportmonksPrediction { + id: number + fixture_id: number + predictions: Record + type_id: number +} + +export interface SportmonksCommentary { + id: number + fixture_id: number + comment: string + minute?: number | null + extra_minute?: number | null + is_goal?: boolean + is_important?: boolean + order?: number +} + +export interface SportmonksTVStation { + id: number + name: string + url?: string | null + image_path?: string | null + type?: string + related_id?: number | null +} + +export interface SportmonksRival { + sport_id: number + team_id: number + rival_id: number +} + +/** + * Output property definitions for a News (article) object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/other + */ +export const SPORTMONKS_NEWS_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the news article' }, + fixture_id: { type: 'number', description: 'Fixture related to the news article' }, + league_id: { type: 'number', description: 'League related to the news article' }, + title: { type: 'string', description: 'Title of the news article' }, + type: { type: 'string', description: 'Type of the news (prematch or postmatch)' }, +} as const satisfies Record + +/** + * Output property definitions for a Statistic object (season/stage/round). + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/statistic + */ +export const SPORTMONKS_STATISTIC_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the statistic record' }, + model_id: { type: 'number', description: 'Id of the entity the statistic belongs to' }, + type_id: { type: 'number', description: 'Type of the statistic' }, + relation_id: { + type: 'number', + description: 'Related entity id (e.g. participant) when applicable', + nullable: true, + optional: true, + }, + value: { type: 'json', description: 'Statistic value payload (varies by type)' }, +} as const satisfies Record + +/** + * Output property definitions for a Standing Correction object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/standing-and-topscorer + */ +export const SPORTMONKS_STANDING_CORRECTION_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the standing correction' }, + season_id: { type: 'number', description: 'Season related to the correction' }, + stage_id: { type: 'number', description: 'Stage related to the correction', nullable: true }, + group_id: { type: 'number', description: 'Group related to the correction', nullable: true }, + type_id: { type: 'number', description: 'Type of the correction' }, + value: { type: 'number', description: 'Amount of points awarded or deducted' }, + calc_type: { type: 'string', description: 'Calculation type applied (e.g. + or -)' }, + participant_type: { type: 'string', description: 'Type of the participant (e.g. team)' }, + participant_id: { type: 'number', description: 'Participant the correction applies to' }, + active: { type: 'boolean', description: 'Whether the correction is active', optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a Match Fact object (beta). + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/match-facts-beta + */ +export const SPORTMONKS_MATCH_FACT_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the match fact' }, + sport_id: { type: 'number', description: 'Sport of the match fact' }, + fixture_id: { type: 'number', description: 'Fixture related to the match fact' }, + type_id: { type: 'number', description: 'Type of the match fact' }, + participant: { type: 'string', description: 'Team the fact relates to (home or away)' }, + basis: { type: 'string', description: 'Basis of the match fact (e.g. h2h, overall)' }, + data: { type: 'json', description: 'Match fact data payload (counts and percentages)' }, + natural_language: { + type: 'string', + description: 'Human-readable description of the match fact', + optional: true, + }, + category: { type: 'string', description: 'Category of the match fact', optional: true }, + scope: { type: 'string', description: 'Scope of the match fact', optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a Team Ranking object (beta). + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/team-rankings-beta + */ +export const SPORTMONKS_TEAM_RANKING_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the team ranking' }, + team_id: { type: 'number', description: 'Team related to the ranking' }, + date: { type: 'string', description: 'Date of the ranking' }, + current_rank: { type: 'number', description: 'Placement of the team on that date' }, + scaled_score: { type: 'number', description: 'Scaled score of the team (0-100)' }, +} as const satisfies Record + +/** + * Output property definitions for a Team of the Week (TOTW) entry. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/team-of-the-week-totw + */ +export const SPORTMONKS_TOTW_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the TOTW entry' }, + player_id: { type: 'number', description: 'Player of the team of the week' }, + fixture_id: { type: 'number', description: 'Fixture the TOTW player played in' }, + round_id: { type: 'number', description: 'Round the fixture is played at' }, + team_id: { type: 'number', description: 'Team the TOTW player played for' }, + rating: { type: 'string', description: 'Rating of the TOTW player' }, + formation_position: { + type: 'number', + description: 'Player position in the TOTW formation', + optional: true, + }, + formation: { type: 'string', description: "The TOTW's formation", optional: true }, +} as const satisfies Record + +/** + * Output property definitions for a Predictability object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/entities/odd-and-prediction + */ +export const SPORTMONKS_PREDICTABILITY_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the predictability record' }, + league_id: { type: 'number', description: 'League related to the predictability' }, + type_id: { type: 'number', description: 'Type of the predictability' }, + data: { type: 'json', description: 'Predictability values per market' }, +} as const satisfies Record + +/** + * Output property definitions for a Live Probability object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/predictions/get-live-probabilities + */ +export const SPORTMONKS_LIVE_PROBABILITY_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the live prediction record' }, + fixture_id: { type: 'number', description: 'Fixture the prediction belongs to' }, + period_id: { type: 'number', description: 'Match period the prediction was recorded in' }, + minute: { type: 'number', description: 'Match minute the prediction was generated' }, + predictions: { + type: 'json', + description: 'Home win, away win and draw probabilities as percentages', + }, + type_id: { type: 'number', description: 'Type of the prediction (237 for fulltime result)' }, +} as const satisfies Record + +/** + * Output property definitions for a Transfer Rumour object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/transfer-rumours + */ +export const SPORTMONKS_TRANSFER_RUMOUR_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the transfer rumour' }, + sport_id: { type: 'number', description: 'Sport of the transfer rumour' }, + player_id: { type: 'number', description: 'Player the rumour relates to' }, + position_id: { + type: 'number', + description: 'Position id of the player', + nullable: true, + optional: true, + }, + from_team_id: { + type: 'number', + description: 'Team the player would transfer from', + nullable: true, + }, + to_team_id: { type: 'number', description: 'Team the player would transfer to', nullable: true }, + transfer_fee_id: { + type: 'number', + description: 'Transfer fee id of the rumour', + nullable: true, + optional: true, + }, + probability: { type: 'string', description: 'Probability of the rumour (e.g. LOW)' }, + source_name: { + type: 'string', + description: 'Name of the source of the rumour', + nullable: true, + optional: true, + }, + source_url: { + type: 'string', + description: 'URL of the source of the rumour', + nullable: true, + optional: true, + }, + amount: { type: 'number', description: 'Estimated transfer fee amount', nullable: true }, + currency: { + type: 'string', + description: 'Currency of the amount', + nullable: true, + optional: true, + }, + date: { type: 'string', description: 'Date of the rumour', nullable: true }, + type_id: { type: 'number', description: 'Type of the transfer rumour' }, +} as const satisfies Record + +/** + * Output property definitions for an Expected Lineup (premium) object. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/premium-expected-lineups + */ +export const SPORTMONKS_EXPECTED_LINEUP_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the expected lineup record' }, + sport_id: { type: 'number', description: 'Sport of the expected lineup' }, + fixture_id: { type: 'number', description: 'Fixture the expected lineup relates to' }, + player_id: { type: 'number', description: 'Player in the expected lineup' }, + team_id: { type: 'number', description: 'Team of the expected lineup player' }, + formation_field: { + type: 'string', + description: 'Formation field of the player', + nullable: true, + optional: true, + }, + position_id: { + type: 'number', + description: 'Position id of the player', + nullable: true, + optional: true, + }, + detailed_position_id: { + type: 'number', + description: 'Detailed position id of the player', + nullable: true, + optional: true, + }, + type_id: { type: 'number', description: 'Type of the expected lineup record' }, + formation_position: { + type: 'number', + description: 'Position of the player in the formation', + nullable: true, + optional: true, + }, + player_name: { type: 'string', description: 'Name of the player', optional: true }, + jersey_number: { + type: 'number', + description: 'Jersey number of the player', + nullable: true, + optional: true, + }, +} as const satisfies Record + +export interface SportmonksNews { + id: number + fixture_id: number + league_id: number + title: string + type: string +} + +export interface SportmonksStatistic { + id: number + model_id: number + type_id: number + relation_id?: number | null + value: Record +} + +export interface SportmonksStandingCorrection { + id: number + season_id: number + stage_id: number | null + group_id: number | null + type_id: number + value: number + calc_type: string + participant_type: string + participant_id: number + active?: boolean +} + +export interface SportmonksMatchFact { + id: number + sport_id: number + fixture_id: number + type_id: number + participant: string + basis: string + data: Record + natural_language?: string + category?: string + scope?: string +} + +export interface SportmonksTeamRanking { + id: number + team_id: number + date: string + current_rank: number + scaled_score: number +} + +export interface SportmonksTotw { + id: number + player_id: number + fixture_id: number + round_id: number + team_id: number + rating: string + formation_position?: number + formation?: string +} + +export interface SportmonksPredictability { + id: number + league_id: number + type_id: number + data: Record +} + +export interface SportmonksLiveProbability { + id: number + fixture_id: number + period_id: number + minute: number + predictions: Record + type_id: number +} + +export interface SportmonksTransferRumour { + id: number + sport_id: number + player_id: number + position_id?: number | null + from_team_id: number | null + to_team_id: number | null + transfer_fee_id?: number | null + probability: string + source_name?: string | null + source_url?: string | null + amount: number | null + currency?: string | null + date: string | null + type_id: number +} + +export interface SportmonksExpectedLineup { + id: number + sport_id: number + fixture_id: number + player_id: number + team_id: number + formation_field?: string | null + position_id?: number | null + detailed_position_id?: number | null + type_id: number + formation_position?: number | null + player_name?: string + jersey_number?: number | null +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_all_fixtures.ts b/apps/sim/tools/sportmonks_motorsport/get_all_fixtures.ts new file mode 100644 index 00000000000..741f0c8ad6c --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_all_fixtures.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_FIXTURE_PROPERTIES, + type SportmonksMsFixture, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetAllFixturesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetAllFixturesResponse extends ToolResponse { + output: { + fixtures: SportmonksMsFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetAllFixturesTool: ToolConfig< + SportmonksMsGetAllFixturesParams, + SportmonksMsGetAllFixturesResponse +> = { + id: 'sportmonks_motorsport_get_all_fixtures', + name: 'Get All Motorsport Fixtures', + description: 'Retrieve all motorsport fixtures (sessions) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;results)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_fixtures') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of motorsport fixture (session) objects', + items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_current_leagues_by_team.ts b/apps/sim/tools/sportmonks_motorsport/get_current_leagues_by_team.ts new file mode 100644 index 00000000000..691f480dc82 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_current_leagues_by_team.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetCurrentLeaguesByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksMsGetCurrentLeaguesByTeamResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetCurrentLeaguesByTeamTool: ToolConfig< + SportmonksMsGetCurrentLeaguesByTeamParams, + SportmonksMsGetCurrentLeaguesByTeamResponse +> = { + id: 'sportmonks_motorsport_get_current_leagues_by_team', + name: 'Get Current Leagues by Team', + description: 'Retrieve the current motorsport leagues for a team by team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team (constructor)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/teams/${encodeURIComponent(params.teamId.trim())}/current` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_current_leagues_by_team') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of current league objects for the team', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_driver_standings.ts b/apps/sim/tools/sportmonks_motorsport/get_driver_standings.ts new file mode 100644 index 00000000000..5c2ac3716e4 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_driver_standings.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STANDING_PROPERTIES, + type SportmonksMsStanding, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetDriverStandingsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetDriverStandingsResponse extends ToolResponse { + output: { + standings: SportmonksMsStanding[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetDriverStandingsTool: ToolConfig< + SportmonksMsGetDriverStandingsParams, + SportmonksMsGetDriverStandingsResponse +> = { + id: 'sportmonks_motorsport_get_driver_standings', + name: 'Get All Driver Standings', + description: 'Retrieve all driver championship standings from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participant;season)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/standings/drivers`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_driver_standings') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + standings: { + type: 'array', + description: 'Array of driver standing entries', + items: { type: 'object', properties: SPORTMONKS_MS_STANDING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_drivers_by_country.ts b/apps/sim/tools/sportmonks_motorsport/get_drivers_by_country.ts new file mode 100644 index 00000000000..24e6fc1a9bd --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_drivers_by_country.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_DRIVER_PROPERTIES, + type SportmonksMsDriver, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetDriversByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksMsGetDriversByCountryResponse extends ToolResponse { + output: { + drivers: SportmonksMsDriver[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetDriversByCountryTool: ToolConfig< + SportmonksMsGetDriversByCountryParams, + SportmonksMsGetDriversByCountryResponse +> = { + id: 'sportmonks_motorsport_get_drivers_by_country', + name: 'Get Drivers by Country', + description: 'Retrieve all motorsport drivers for a country by country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/drivers/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_drivers_by_country') + } + return { + success: true, + output: { + drivers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + drivers: { + type: 'array', + description: 'Array of driver objects for the country', + items: { type: 'object', properties: SPORTMONKS_MS_DRIVER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_drivers_by_season.ts b/apps/sim/tools/sportmonks_motorsport/get_drivers_by_season.ts new file mode 100644 index 00000000000..cc977dc7bb0 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_drivers_by_season.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_DRIVER_PROPERTIES, + type SportmonksMsDriver, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetDriversBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksMsGetDriversBySeasonResponse extends ToolResponse { + output: { + drivers: SportmonksMsDriver[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetDriversBySeasonTool: ToolConfig< + SportmonksMsGetDriversBySeasonParams, + SportmonksMsGetDriversBySeasonResponse +> = { + id: 'sportmonks_motorsport_get_drivers_by_season', + name: 'Get Drivers by Season', + description: 'Retrieve all motorsport drivers for a season by season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/drivers/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_drivers_by_season') + } + return { + success: true, + output: { + drivers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + drivers: { + type: 'array', + description: 'Array of driver objects for the season', + items: { type: 'object', properties: SPORTMONKS_MS_DRIVER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_date_range.ts b/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_date_range.ts new file mode 100644 index 00000000000..62cd2b7411b --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_date_range.ts @@ -0,0 +1,123 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_FIXTURE_PROPERTIES, + type SportmonksMsFixture, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetFixturesByDateRangeParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + startDate: string + endDate: string +} + +export interface SportmonksMsGetFixturesByDateRangeResponse extends ToolResponse { + output: { + fixtures: SportmonksMsFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetFixturesByDateRangeTool: ToolConfig< + SportmonksMsGetFixturesByDateRangeParams, + SportmonksMsGetFixturesByDateRangeResponse +> = { + id: 'sportmonks_motorsport_get_fixtures_by_date_range', + name: 'Get Motorsport Fixtures by Date Range', + description: + 'Retrieve motorsport fixtures (sessions) between two dates (YYYY-MM-DD, max 100 days) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + startDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The start date of the range, in YYYY-MM-DD format', + }, + endDate: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The end date of the range, in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participants;venue)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order fixtures by starting_at (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/between/${encodeURIComponent(params.startDate.trim())}/${encodeURIComponent(params.endDate.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_fixtures_by_date_range') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of motorsport fixture (session) objects within the requested date range', + items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_ids.ts b/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_ids.ts new file mode 100644 index 00000000000..fc62a4da3b6 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_fixtures_by_ids.ts @@ -0,0 +1,117 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_FIXTURE_PROPERTIES, + type SportmonksMsFixture, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetFixturesByIdsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureIds: string +} + +export interface SportmonksMsGetFixturesByIdsResponse extends ToolResponse { + output: { + fixtures: SportmonksMsFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetFixturesByIdsTool: ToolConfig< + SportmonksMsGetFixturesByIdsParams, + SportmonksMsGetFixturesByIdsResponse +> = { + id: 'sportmonks_motorsport_get_fixtures_by_ids', + name: 'Get Motorsport Fixtures by IDs', + description: + 'Retrieve multiple motorsport fixtures (sessions) by their IDs (max 50) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureIds: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Comma-separated list of fixture ids (max 50, e.g. 19408487,19408480)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;results)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/multi/${encodeURIComponent(params.fixtureIds.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_fixtures_by_ids') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of motorsport fixture (session) objects for the requested ids', + items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_driver.ts b/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_driver.ts new file mode 100644 index 00000000000..7d2c6d5a200 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_driver.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLapsByFixtureAndDriverParams extends SportmonksBaseParams { + fixtureId: string + driverId: string +} + +export interface SportmonksMsGetLapsByFixtureAndDriverResponse extends ToolResponse { + output: { + laps: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetLapsByFixtureAndDriverTool: ToolConfig< + SportmonksMsGetLapsByFixtureAndDriverParams, + SportmonksMsGetLapsByFixtureAndDriverResponse +> = { + id: 'sportmonks_motorsport_get_laps_by_fixture_and_driver', + name: 'Get Laps by Fixture and Driver', + description: 'Retrieve all laps for a motorsport fixture and driver from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + driverId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the driver', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/laps/drivers/${encodeURIComponent(params.driverId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_laps_by_fixture_and_driver') + } + return { + success: true, + output: { + laps: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + laps: { + type: 'array', + description: 'Array of lap objects for the fixture and driver', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_lap.ts b/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_lap.ts new file mode 100644 index 00000000000..54998fa692b --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_laps_by_fixture_and_lap.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLapsByFixtureAndLapParams extends SportmonksBaseParams { + fixtureId: string + lapNumber: string +} + +export interface SportmonksMsGetLapsByFixtureAndLapResponse extends ToolResponse { + output: { + laps: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetLapsByFixtureAndLapTool: ToolConfig< + SportmonksMsGetLapsByFixtureAndLapParams, + SportmonksMsGetLapsByFixtureAndLapResponse +> = { + id: 'sportmonks_motorsport_get_laps_by_fixture_and_lap', + name: 'Get Laps by Fixture and Lap Number', + description: 'Retrieve all laps for a motorsport fixture and lap number from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + lapNumber: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The lap number to retrieve', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/laps/${encodeURIComponent(params.lapNumber.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_laps_by_fixture_and_lap') + } + return { + success: true, + output: { + laps: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + laps: { + type: 'array', + description: 'Array of lap objects for the fixture and lap number', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_latest_laps_by_fixture.ts b/apps/sim/tools/sportmonks_motorsport/get_latest_laps_by_fixture.ts new file mode 100644 index 00000000000..0d24a7943e0 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_latest_laps_by_fixture.ts @@ -0,0 +1,91 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLatestLapsByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksMsGetLatestLapsByFixtureResponse extends ToolResponse { + output: { + laps: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetLatestLapsByFixtureTool: ToolConfig< + SportmonksMsGetLatestLapsByFixtureParams, + SportmonksMsGetLatestLapsByFixtureResponse +> = { + id: 'sportmonks_motorsport_get_latest_laps_by_fixture', + name: 'Get Latest Laps by Fixture', + description: + 'Retrieve the latest laps for a motorsport fixture (session) by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/laps/latest` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_laps_by_fixture') + } + return { + success: true, + output: { + laps: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + laps: { + type: 'array', + description: 'Array of the latest lap objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_latest_pitstops_by_fixture.ts b/apps/sim/tools/sportmonks_motorsport/get_latest_pitstops_by_fixture.ts new file mode 100644 index 00000000000..711576875de --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_latest_pitstops_by_fixture.ts @@ -0,0 +1,91 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLatestPitstopsByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksMsGetLatestPitstopsByFixtureResponse extends ToolResponse { + output: { + pitstops: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetLatestPitstopsByFixtureTool: ToolConfig< + SportmonksMsGetLatestPitstopsByFixtureParams, + SportmonksMsGetLatestPitstopsByFixtureResponse +> = { + id: 'sportmonks_motorsport_get_latest_pitstops_by_fixture', + name: 'Get Latest Pitstops by Fixture', + description: + 'Retrieve the latest pitstops for a motorsport fixture (session) by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/pitstops/latest` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_pitstops_by_fixture') + } + return { + success: true, + output: { + pitstops: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + pitstops: { + type: 'array', + description: 'Array of the latest pitstop objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_latest_stints_by_fixture.ts b/apps/sim/tools/sportmonks_motorsport/get_latest_stints_by_fixture.ts new file mode 100644 index 00000000000..44ce3a37bfa --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_latest_stints_by_fixture.ts @@ -0,0 +1,91 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STINT_PROPERTIES, + type SportmonksMsStint, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLatestStintsByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksMsGetLatestStintsByFixtureResponse extends ToolResponse { + output: { + stints: SportmonksMsStint[] + } +} + +export const sportmonksMotorsportGetLatestStintsByFixtureTool: ToolConfig< + SportmonksMsGetLatestStintsByFixtureParams, + SportmonksMsGetLatestStintsByFixtureResponse +> = { + id: 'sportmonks_motorsport_get_latest_stints_by_fixture', + name: 'Get Latest Stints by Fixture', + description: + 'Retrieve the latest tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/stints/latest` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_stints_by_fixture') + } + return { + success: true, + output: { + stints: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + stints: { + type: 'array', + description: 'Array of the latest stint objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_MS_STINT_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_latest_updated_drivers.ts b/apps/sim/tools/sportmonks_motorsport/get_latest_updated_drivers.ts new file mode 100644 index 00000000000..e357839e842 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_latest_updated_drivers.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_DRIVER_PROPERTIES, + type SportmonksMsDriver, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLatestUpdatedDriversParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetLatestUpdatedDriversResponse extends ToolResponse { + output: { + drivers: SportmonksMsDriver[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLatestUpdatedDriversTool: ToolConfig< + SportmonksMsGetLatestUpdatedDriversParams, + SportmonksMsGetLatestUpdatedDriversResponse +> = { + id: 'sportmonks_motorsport_get_latest_updated_drivers', + name: 'Get Latest Updated Drivers', + description: 'Retrieve the most recently updated motorsport drivers from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/drivers/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_updated_drivers') + } + return { + success: true, + output: { + drivers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + drivers: { + type: 'array', + description: 'Array of recently updated driver objects', + items: { type: 'object', properties: SPORTMONKS_MS_DRIVER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_latest_updated_fixtures.ts b/apps/sim/tools/sportmonks_motorsport/get_latest_updated_fixtures.ts new file mode 100644 index 00000000000..f4753f63835 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_latest_updated_fixtures.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_FIXTURE_PROPERTIES, + type SportmonksMsFixture, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLatestUpdatedFixturesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetLatestUpdatedFixturesResponse extends ToolResponse { + output: { + fixtures: SportmonksMsFixture[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLatestUpdatedFixturesTool: ToolConfig< + SportmonksMsGetLatestUpdatedFixturesParams, + SportmonksMsGetLatestUpdatedFixturesResponse +> = { + id: 'sportmonks_motorsport_get_latest_updated_fixtures', + name: 'Get Latest Updated Motorsport Fixtures', + description: 'Retrieve the most recently updated motorsport fixtures (sessions) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participants;results)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_latest_updated_fixtures') + } + return { + success: true, + output: { + fixtures: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + fixtures: { + type: 'array', + description: 'Array of recently updated motorsport fixture (session) objects', + items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_league.ts b/apps/sim/tools/sportmonks_motorsport/get_league.ts new file mode 100644 index 00000000000..154102f9a60 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_league.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeagueParams extends SportmonksBaseParams { + leagueId: string +} + +export interface SportmonksMsGetLeagueResponse extends ToolResponse { + output: { + league: SportmonksMsLeague | null + } +} + +export const sportmonksMotorsportGetLeagueTool: ToolConfig< + SportmonksMsGetLeagueParams, + SportmonksMsGetLeagueResponse +> = { + id: 'sportmonks_motorsport_get_league', + name: 'Get League by ID', + description: 'Retrieve a single motorsport league by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + leagueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the league', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/${encodeURIComponent(params.leagueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_league') + } + return { + success: true, + output: { + league: data.data ?? null, + }, + } + }, + + outputs: { + league: { + type: 'object', + description: 'The requested league object', + properties: SPORTMONKS_MS_LEAGUE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_leagues.ts b/apps/sim/tools/sportmonks_motorsport/get_leagues.ts new file mode 100644 index 00000000000..864566b3845 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_leagues.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeaguesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetLeaguesResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLeaguesTool: ToolConfig< + SportmonksMsGetLeaguesParams, + SportmonksMsGetLeaguesResponse +> = { + id: 'sportmonks_motorsport_get_leagues', + name: 'Get All Leagues', + description: 'Retrieve all motorsport leagues from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_leagues_by_country.ts b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_country.ts new file mode 100644 index 00000000000..29fba8e8470 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_country.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeaguesByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksMsGetLeaguesByCountryResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLeaguesByCountryTool: ToolConfig< + SportmonksMsGetLeaguesByCountryParams, + SportmonksMsGetLeaguesByCountryResponse +> = { + id: 'sportmonks_motorsport_get_leagues_by_country', + name: 'Get Leagues by Country', + description: 'Retrieve all motorsport leagues for a country by country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_country') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects for the country', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_leagues_by_date.ts b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_date.ts new file mode 100644 index 00000000000..024bc334722 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_date.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeaguesByDateParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + date: string +} + +export interface SportmonksMsGetLeaguesByDateResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLeaguesByDateTool: ToolConfig< + SportmonksMsGetLeaguesByDateParams, + SportmonksMsGetLeaguesByDateResponse +> = { + id: 'sportmonks_motorsport_get_leagues_by_date', + name: 'Get Leagues by Fixture Date', + description: + 'Retrieve all motorsport leagues with fixtures on a specific date (YYYY-MM-DD) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + date: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The date to fetch leagues for, in YYYY-MM-DD format', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/date/${encodeURIComponent(params.date.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_date') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects with fixtures on the requested date', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_leagues_by_live.ts b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_live.ts new file mode 100644 index 00000000000..6cedc2f847b --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_live.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeaguesByLiveParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetLeaguesByLiveResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLeaguesByLiveTool: ToolConfig< + SportmonksMsGetLeaguesByLiveParams, + SportmonksMsGetLeaguesByLiveResponse +> = { + id: 'sportmonks_motorsport_get_leagues_by_live', + name: 'Get Leagues by Live', + description: 'Retrieve all motorsport leagues that currently have live fixtures from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/live`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_live') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects that currently have live fixtures', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_leagues_by_team.ts b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_team.ts new file mode 100644 index 00000000000..f4f5b6085a9 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_leagues_by_team.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetLeaguesByTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + teamId: string +} + +export interface SportmonksMsGetLeaguesByTeamResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetLeaguesByTeamTool: ToolConfig< + SportmonksMsGetLeaguesByTeamParams, + SportmonksMsGetLeaguesByTeamResponse +> = { + id: 'sportmonks_motorsport_get_leagues_by_team', + name: 'Get Leagues by Team', + description: + 'Retrieve all current and historical motorsport leagues for a team by team ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team (constructor)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_leagues_by_team') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects for the team', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_driver.ts b/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_driver.ts new file mode 100644 index 00000000000..15326780a68 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_driver.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetPitstopsByFixtureAndDriverParams extends SportmonksBaseParams { + fixtureId: string + driverId: string +} + +export interface SportmonksMsGetPitstopsByFixtureAndDriverResponse extends ToolResponse { + output: { + pitstops: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetPitstopsByFixtureAndDriverTool: ToolConfig< + SportmonksMsGetPitstopsByFixtureAndDriverParams, + SportmonksMsGetPitstopsByFixtureAndDriverResponse +> = { + id: 'sportmonks_motorsport_get_pitstops_by_fixture_and_driver', + name: 'Get Pitstops by Fixture and Driver', + description: 'Retrieve all pitstops for a motorsport fixture and driver from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + driverId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the driver', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/pitstops/drivers/${encodeURIComponent(params.driverId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_pitstops_by_fixture_and_driver') + } + return { + success: true, + output: { + pitstops: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + pitstops: { + type: 'array', + description: 'Array of pitstop objects for the fixture and driver', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_lap.ts b/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_lap.ts new file mode 100644 index 00000000000..9e74c40983c --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_pitstops_by_fixture_and_lap.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LAP_PROPERTIES, + type SportmonksMsLap, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetPitstopsByFixtureAndLapParams extends SportmonksBaseParams { + fixtureId: string + lapNumber: string +} + +export interface SportmonksMsGetPitstopsByFixtureAndLapResponse extends ToolResponse { + output: { + pitstops: SportmonksMsLap[] + } +} + +export const sportmonksMotorsportGetPitstopsByFixtureAndLapTool: ToolConfig< + SportmonksMsGetPitstopsByFixtureAndLapParams, + SportmonksMsGetPitstopsByFixtureAndLapResponse +> = { + id: 'sportmonks_motorsport_get_pitstops_by_fixture_and_lap', + name: 'Get Pitstops by Fixture and Lap Number', + description: 'Retrieve all pitstops for a motorsport fixture and lap number from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + lapNumber: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The lap number to retrieve', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/pitstops/${encodeURIComponent(params.lapNumber.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_pitstops_by_fixture_and_lap') + } + return { + success: true, + output: { + pitstops: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + pitstops: { + type: 'array', + description: 'Array of pitstop objects for the fixture and lap number', + items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_driver.ts b/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_driver.ts new file mode 100644 index 00000000000..3fcbd696bb2 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_driver.ts @@ -0,0 +1,124 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetRaceResultsBySeasonAndDriverParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string + driverId: string +} + +export interface SportmonksMsGetRaceResultsBySeasonAndDriverResponse extends ToolResponse { + output: { + results: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetRaceResultsBySeasonAndDriverTool: ToolConfig< + SportmonksMsGetRaceResultsBySeasonAndDriverParams, + SportmonksMsGetRaceResultsBySeasonAndDriverResponse +> = { + id: 'sportmonks_motorsport_get_race_results_by_season_and_driver', + name: 'Get Race Results by Season and Driver', + description: + 'Retrieve race results (stages with fixtures, lineups and lineup details) for a season and driver from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + driverId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the driver', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/results/seasons/${encodeURIComponent(params.seasonId.trim())}/drivers/${encodeURIComponent(params.driverId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_race_results_by_season_and_driver') + } + return { + success: true, + output: { + results: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + results: { + type: 'array', + description: + 'Array of stage objects for the season and driver, each including nested fixtures, lineups and lineup details', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_team.ts b/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_team.ts new file mode 100644 index 00000000000..ddcf3082df3 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_race_results_by_season_and_team.ts @@ -0,0 +1,124 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetRaceResultsBySeasonAndTeamParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string + teamId: string +} + +export interface SportmonksMsGetRaceResultsBySeasonAndTeamResponse extends ToolResponse { + output: { + results: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetRaceResultsBySeasonAndTeamTool: ToolConfig< + SportmonksMsGetRaceResultsBySeasonAndTeamParams, + SportmonksMsGetRaceResultsBySeasonAndTeamResponse +> = { + id: 'sportmonks_motorsport_get_race_results_by_season_and_team', + name: 'Get Race Results by Season and Team', + description: + 'Retrieve race results (stages with fixtures, lineups and lineup details) for a season and team from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + teamId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the team (constructor)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/results/seasons/${encodeURIComponent(params.seasonId.trim())}/teams/${encodeURIComponent(params.teamId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_race_results_by_season_and_team') + } + return { + success: true, + output: { + results: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + results: { + type: 'array', + description: + 'Array of stage objects for the season and team, each including nested fixtures, lineups and lineup details', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_schedules_by_season.ts b/apps/sim/tools/sportmonks_motorsport/get_schedules_by_season.ts new file mode 100644 index 00000000000..182ce0090d9 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_schedules_by_season.ts @@ -0,0 +1,117 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetSchedulesBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksMsGetSchedulesBySeasonResponse extends ToolResponse { + output: { + schedules: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetSchedulesBySeasonTool: ToolConfig< + SportmonksMsGetSchedulesBySeasonParams, + SportmonksMsGetSchedulesBySeasonResponse +> = { + id: 'sportmonks_motorsport_get_schedules_by_season', + name: 'Get Schedules by Season', + description: + 'Retrieve the full schedule (stages with nested fixtures and venues) for a season by season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/schedules/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_schedules_by_season') + } + return { + success: true, + output: { + schedules: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + schedules: { + type: 'array', + description: + 'Array of stage objects for the season schedule, each including nested fixtures and venues', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_season.ts b/apps/sim/tools/sportmonks_motorsport/get_season.ts new file mode 100644 index 00000000000..6019601d400 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_season.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_SEASON_PROPERTIES, + type SportmonksMsSeason, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetSeasonParams extends SportmonksBaseParams { + seasonId: string +} + +export interface SportmonksMsGetSeasonResponse extends ToolResponse { + output: { + season: SportmonksMsSeason | null + } +} + +export const sportmonksMotorsportGetSeasonTool: ToolConfig< + SportmonksMsGetSeasonParams, + SportmonksMsGetSeasonResponse +> = { + id: 'sportmonks_motorsport_get_season', + name: 'Get Season by ID', + description: 'Retrieve a single motorsport season by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;stages)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_season') + } + return { + success: true, + output: { + season: data.data ?? null, + }, + } + }, + + outputs: { + season: { + type: 'object', + description: 'The requested season object', + properties: SPORTMONKS_MS_SEASON_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_seasons.ts b/apps/sim/tools/sportmonks_motorsport/get_seasons.ts new file mode 100644 index 00000000000..ce2891307ef --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_seasons.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_SEASON_PROPERTIES, + type SportmonksMsSeason, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetSeasonsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetSeasonsResponse extends ToolResponse { + output: { + seasons: SportmonksMsSeason[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetSeasonsTool: ToolConfig< + SportmonksMsGetSeasonsParams, + SportmonksMsGetSeasonsResponse +> = { + id: 'sportmonks_motorsport_get_seasons', + name: 'Get All Seasons', + description: 'Retrieve all motorsport seasons from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. league;stages)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/seasons`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_seasons') + } + return { + success: true, + output: { + seasons: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + seasons: { + type: 'array', + description: 'Array of season objects', + items: { type: 'object', properties: SPORTMONKS_MS_SEASON_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stage.ts b/apps/sim/tools/sportmonks_motorsport/get_stage.ts new file mode 100644 index 00000000000..026d2237251 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stage.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStageParams extends SportmonksBaseParams { + stageId: string +} + +export interface SportmonksMsGetStageResponse extends ToolResponse { + output: { + stage: SportmonksMsStage | null + } +} + +export const sportmonksMotorsportGetStageTool: ToolConfig< + SportmonksMsGetStageParams, + SportmonksMsGetStageResponse +> = { + id: 'sportmonks_motorsport_get_stage', + name: 'Get Stage by ID', + description: 'Retrieve a single motorsport stage (race weekend) by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stageId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the stage (race weekend)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/stages/${encodeURIComponent(params.stageId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stage') + } + return { + success: true, + output: { + stage: data.data ?? null, + }, + } + }, + + outputs: { + stage: { + type: 'object', + description: 'The requested stage (race weekend) object', + properties: SPORTMONKS_MS_STAGE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stages.ts b/apps/sim/tools/sportmonks_motorsport/get_stages.ts new file mode 100644 index 00000000000..45345827aa5 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stages.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStagesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetStagesResponse extends ToolResponse { + output: { + stages: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetStagesTool: ToolConfig< + SportmonksMsGetStagesParams, + SportmonksMsGetStagesResponse +> = { + id: 'sportmonks_motorsport_get_stages', + name: 'Get All Stages', + description: 'Retrieve all motorsport stages (race weekends) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/stages`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stages') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage (race weekend) objects', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stages_by_season.ts b/apps/sim/tools/sportmonks_motorsport/get_stages_by_season.ts new file mode 100644 index 00000000000..4cc08fd1df0 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stages_by_season.ts @@ -0,0 +1,117 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStagesBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksMsGetStagesBySeasonResponse extends ToolResponse { + output: { + stages: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetStagesBySeasonTool: ToolConfig< + SportmonksMsGetStagesBySeasonParams, + SportmonksMsGetStagesBySeasonResponse +> = { + id: 'sportmonks_motorsport_get_stages_by_season', + name: 'Get Stages by Season', + description: + 'Retrieve all motorsport stages (race weekends) for a season by season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/stages/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stages_by_season') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage (race weekend) objects for the season', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_state.ts b/apps/sim/tools/sportmonks_motorsport/get_state.ts new file mode 100644 index 00000000000..2ba8236a08b --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_state.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STATE_PROPERTIES, + type SportmonksMsState, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStateParams extends SportmonksBaseParams { + stateId: string +} + +export interface SportmonksMsGetStateResponse extends ToolResponse { + output: { + state: SportmonksMsState | null + } +} + +export const sportmonksMotorsportGetStateTool: ToolConfig< + SportmonksMsGetStateParams, + SportmonksMsGetStateResponse +> = { + id: 'sportmonks_motorsport_get_state', + name: 'Get State by ID', + description: 'Retrieve a single motorsport fixture state by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + stateId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the state', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/states/${encodeURIComponent(params.stateId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_state') + } + return { + success: true, + output: { + state: data.data ?? null, + }, + } + }, + + outputs: { + state: { + type: 'object', + description: 'The requested fixture state object', + properties: SPORTMONKS_MS_STATE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_states.ts b/apps/sim/tools/sportmonks_motorsport/get_states.ts new file mode 100644 index 00000000000..744f2ca48a9 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_states.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STATE_PROPERTIES, + type SportmonksMsState, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStatesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetStatesResponse extends ToolResponse { + output: { + states: SportmonksMsState[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetStatesTool: ToolConfig< + SportmonksMsGetStatesParams, + SportmonksMsGetStatesResponse +> = { + id: 'sportmonks_motorsport_get_states', + name: 'Get All States', + description: 'Retrieve all possible motorsport fixture states from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/states`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_states') + } + return { + success: true, + output: { + states: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + states: { + type: 'array', + description: 'Array of fixture state objects', + items: { type: 'object', properties: SPORTMONKS_MS_STATE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture.ts b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture.ts new file mode 100644 index 00000000000..5696ae4672e --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture.ts @@ -0,0 +1,91 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STINT_PROPERTIES, + type SportmonksMsStint, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStintsByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksMsGetStintsByFixtureResponse extends ToolResponse { + output: { + stints: SportmonksMsStint[] + } +} + +export const sportmonksMotorsportGetStintsByFixtureTool: ToolConfig< + SportmonksMsGetStintsByFixtureParams, + SportmonksMsGetStintsByFixtureResponse +> = { + id: 'sportmonks_motorsport_get_stints_by_fixture', + name: 'Get Stints by Fixture', + description: + 'Retrieve all tyre stints for a motorsport fixture (session) by fixture ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/stints` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stints_by_fixture') + } + return { + success: true, + output: { + stints: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + stints: { + type: 'array', + description: 'Array of stint objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_MS_STINT_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_driver.ts b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_driver.ts new file mode 100644 index 00000000000..43623b3ebf9 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_driver.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STINT_PROPERTIES, + type SportmonksMsStint, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStintsByFixtureAndDriverParams extends SportmonksBaseParams { + fixtureId: string + driverId: string +} + +export interface SportmonksMsGetStintsByFixtureAndDriverResponse extends ToolResponse { + output: { + stints: SportmonksMsStint[] + } +} + +export const sportmonksMotorsportGetStintsByFixtureAndDriverTool: ToolConfig< + SportmonksMsGetStintsByFixtureAndDriverParams, + SportmonksMsGetStintsByFixtureAndDriverResponse +> = { + id: 'sportmonks_motorsport_get_stints_by_fixture_and_driver', + name: 'Get Stints by Fixture and Driver', + description: 'Retrieve all tyre stints for a motorsport fixture and driver from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + driverId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the driver', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/stints/drivers/${encodeURIComponent(params.driverId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stints_by_fixture_and_driver') + } + return { + success: true, + output: { + stints: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + stints: { + type: 'array', + description: 'Array of stint objects for the fixture and driver', + items: { type: 'object', properties: SPORTMONKS_MS_STINT_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_stint.ts b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_stint.ts new file mode 100644 index 00000000000..1f6798ed26d --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_stints_by_fixture_and_stint.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STINT_PROPERTIES, + type SportmonksMsStint, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetStintsByFixtureAndStintParams extends SportmonksBaseParams { + fixtureId: string + stintNumber: string +} + +export interface SportmonksMsGetStintsByFixtureAndStintResponse extends ToolResponse { + output: { + stints: SportmonksMsStint[] + } +} + +export const sportmonksMotorsportGetStintsByFixtureAndStintTool: ToolConfig< + SportmonksMsGetStintsByFixtureAndStintParams, + SportmonksMsGetStintsByFixtureAndStintResponse +> = { + id: 'sportmonks_motorsport_get_stints_by_fixture_and_stint', + name: 'Get Stints by Fixture and Stint Number', + description: 'Retrieve all tyre stints for a motorsport fixture and stint number from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture (session)', + }, + stintNumber: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The stint number to retrieve', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. participant;details)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/fixtures/${encodeURIComponent(params.fixtureId.trim())}/stints/${encodeURIComponent(params.stintNumber.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_stints_by_fixture_and_stint') + } + return { + success: true, + output: { + stints: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + stints: { + type: 'array', + description: 'Array of stint objects for the fixture and stint number', + items: { type: 'object', properties: SPORTMONKS_MS_STINT_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_team_standings.ts b/apps/sim/tools/sportmonks_motorsport/get_team_standings.ts new file mode 100644 index 00000000000..b0f74b466b7 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_team_standings.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STANDING_PROPERTIES, + type SportmonksMsStanding, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetTeamStandingsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetTeamStandingsResponse extends ToolResponse { + output: { + standings: SportmonksMsStanding[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetTeamStandingsTool: ToolConfig< + SportmonksMsGetTeamStandingsParams, + SportmonksMsGetTeamStandingsResponse +> = { + id: 'sportmonks_motorsport_get_team_standings', + name: 'Get All Team Standings', + description: 'Retrieve all team (constructor) championship standings from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. participant;season)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/standings/teams`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_team_standings') + } + return { + success: true, + output: { + standings: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + standings: { + type: 'array', + description: 'Array of team (constructor) standing entries', + items: { type: 'object', properties: SPORTMONKS_MS_STANDING_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_teams_by_country.ts b/apps/sim/tools/sportmonks_motorsport/get_teams_by_country.ts new file mode 100644 index 00000000000..38ea78210c0 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_teams_by_country.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_TEAM_PROPERTIES, + type SportmonksMsTeam, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetTeamsByCountryParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + countryId: string +} + +export interface SportmonksMsGetTeamsByCountryResponse extends ToolResponse { + output: { + teams: SportmonksMsTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetTeamsByCountryTool: ToolConfig< + SportmonksMsGetTeamsByCountryParams, + SportmonksMsGetTeamsByCountryResponse +> = { + id: 'sportmonks_motorsport_get_teams_by_country', + name: 'Get Teams by Country', + description: + 'Retrieve all motorsport teams (constructors) for a country by country ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + countryId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the country', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;drivers)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/teams/countries/${encodeURIComponent(params.countryId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_teams_by_country') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team (constructor) objects for the country', + items: { type: 'object', properties: SPORTMONKS_MS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_teams_by_season.ts b/apps/sim/tools/sportmonks_motorsport/get_teams_by_season.ts new file mode 100644 index 00000000000..cf651b51c1b --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_teams_by_season.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_TEAM_PROPERTIES, + type SportmonksMsTeam, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetTeamsBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksMsGetTeamsBySeasonResponse extends ToolResponse { + output: { + teams: SportmonksMsTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetTeamsBySeasonTool: ToolConfig< + SportmonksMsGetTeamsBySeasonParams, + SportmonksMsGetTeamsBySeasonResponse +> = { + id: 'sportmonks_motorsport_get_teams_by_season', + name: 'Get Teams by Season', + description: + 'Retrieve all motorsport teams (constructors) for a season by season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;drivers)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/teams/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_teams_by_season') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team (constructor) objects for the season', + items: { type: 'object', properties: SPORTMONKS_MS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_venue.ts b/apps/sim/tools/sportmonks_motorsport/get_venue.ts new file mode 100644 index 00000000000..a603b448cbb --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_venue.ts @@ -0,0 +1,89 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_VENUE_PROPERTIES, + type SportmonksMsVenue, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetVenueParams extends SportmonksBaseParams { + venueId: string +} + +export interface SportmonksMsGetVenueResponse extends ToolResponse { + output: { + venue: SportmonksMsVenue | null + } +} + +export const sportmonksMotorsportGetVenueTool: ToolConfig< + SportmonksMsGetVenueParams, + SportmonksMsGetVenueResponse +> = { + id: 'sportmonks_motorsport_get_venue', + name: 'Get Venue by ID', + description: 'Retrieve a single motorsport venue (racing track) by its ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + venueId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the venue (track)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/venues/${encodeURIComponent(params.venueId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venue') + } + return { + success: true, + output: { + venue: data.data ?? null, + }, + } + }, + + outputs: { + venue: { + type: 'object', + description: 'The requested venue (racing track) object', + properties: SPORTMONKS_MS_VENUE_PROPERTIES, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_venues.ts b/apps/sim/tools/sportmonks_motorsport/get_venues.ts new file mode 100644 index 00000000000..c1cb8c93bc4 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_venues.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_VENUE_PROPERTIES, + type SportmonksMsVenue, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetVenuesParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksMsGetVenuesResponse extends ToolResponse { + output: { + venues: SportmonksMsVenue[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetVenuesTool: ToolConfig< + SportmonksMsGetVenuesParams, + SportmonksMsGetVenuesResponse +> = { + id: 'sportmonks_motorsport_get_venues', + name: 'Get Venues', + description: 'Retrieve all motorsport venues (racing tracks) from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_BASE_URL}/venues`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venues') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue (racing track) objects', + items: { type: 'object', properties: SPORTMONKS_MS_VENUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/get_venues_by_season.ts b/apps/sim/tools/sportmonks_motorsport/get_venues_by_season.ts new file mode 100644 index 00000000000..2a8d92fcc09 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/get_venues_by_season.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_VENUE_PROPERTIES, + type SportmonksMsVenue, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsGetVenuesBySeasonParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + seasonId: string +} + +export interface SportmonksMsGetVenuesBySeasonResponse extends ToolResponse { + output: { + venues: SportmonksMsVenue[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportGetVenuesBySeasonTool: ToolConfig< + SportmonksMsGetVenuesBySeasonParams, + SportmonksMsGetVenuesBySeasonResponse +> = { + id: 'sportmonks_motorsport_get_venues_by_season', + name: 'Get Venues by Season', + description: + 'Retrieve all motorsport venues (racing tracks) for a season by season ID from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + seasonId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the season', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/venues/seasons/${encodeURIComponent(params.seasonId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_venues_by_season') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue (racing track) objects for the season', + items: { type: 'object', properties: SPORTMONKS_MS_VENUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/index.ts b/apps/sim/tools/sportmonks_motorsport/index.ts index acc0a9846ba..c208d12a2fd 100644 --- a/apps/sim/tools/sportmonks_motorsport/index.ts +++ b/apps/sim/tools/sportmonks_motorsport/index.ts @@ -1,12 +1,57 @@ +export { sportmonksMotorsportGetAllFixturesTool } from './get_all_fixtures' +export { sportmonksMotorsportGetCurrentLeaguesByTeamTool } from './get_current_leagues_by_team' export { sportmonksMotorsportGetDriverTool } from './get_driver' +export { sportmonksMotorsportGetDriverStandingsTool } from './get_driver_standings' export { sportmonksMotorsportGetDriverStandingsBySeasonTool } from './get_driver_standings_by_season' export { sportmonksMotorsportGetDriversTool } from './get_drivers' +export { sportmonksMotorsportGetDriversByCountryTool } from './get_drivers_by_country' +export { sportmonksMotorsportGetDriversBySeasonTool } from './get_drivers_by_season' export { sportmonksMotorsportGetFixtureTool } from './get_fixture' export { sportmonksMotorsportGetFixturesByDateTool } from './get_fixtures_by_date' +export { sportmonksMotorsportGetFixturesByDateRangeTool } from './get_fixtures_by_date_range' +export { sportmonksMotorsportGetFixturesByIdsTool } from './get_fixtures_by_ids' export { sportmonksMotorsportGetLapsByFixtureTool } from './get_laps_by_fixture' +export { sportmonksMotorsportGetLapsByFixtureAndDriverTool } from './get_laps_by_fixture_and_driver' +export { sportmonksMotorsportGetLapsByFixtureAndLapTool } from './get_laps_by_fixture_and_lap' +export { sportmonksMotorsportGetLatestLapsByFixtureTool } from './get_latest_laps_by_fixture' +export { sportmonksMotorsportGetLatestPitstopsByFixtureTool } from './get_latest_pitstops_by_fixture' +export { sportmonksMotorsportGetLatestStintsByFixtureTool } from './get_latest_stints_by_fixture' +export { sportmonksMotorsportGetLatestUpdatedDriversTool } from './get_latest_updated_drivers' +export { sportmonksMotorsportGetLatestUpdatedFixturesTool } from './get_latest_updated_fixtures' +export { sportmonksMotorsportGetLeagueTool } from './get_league' +export { sportmonksMotorsportGetLeaguesTool } from './get_leagues' +export { sportmonksMotorsportGetLeaguesByCountryTool } from './get_leagues_by_country' +export { sportmonksMotorsportGetLeaguesByDateTool } from './get_leagues_by_date' +export { sportmonksMotorsportGetLeaguesByLiveTool } from './get_leagues_by_live' +export { sportmonksMotorsportGetLeaguesByTeamTool } from './get_leagues_by_team' export { sportmonksMotorsportGetLivescoresTool } from './get_livescores' export { sportmonksMotorsportGetPitstopsByFixtureTool } from './get_pitstops_by_fixture' +export { sportmonksMotorsportGetPitstopsByFixtureAndDriverTool } from './get_pitstops_by_fixture_and_driver' +export { sportmonksMotorsportGetPitstopsByFixtureAndLapTool } from './get_pitstops_by_fixture_and_lap' +export { sportmonksMotorsportGetRaceResultsBySeasonAndDriverTool } from './get_race_results_by_season_and_driver' +export { sportmonksMotorsportGetRaceResultsBySeasonAndTeamTool } from './get_race_results_by_season_and_team' +export { sportmonksMotorsportGetSchedulesBySeasonTool } from './get_schedules_by_season' +export { sportmonksMotorsportGetSeasonTool } from './get_season' +export { sportmonksMotorsportGetSeasonsTool } from './get_seasons' +export { sportmonksMotorsportGetStageTool } from './get_stage' +export { sportmonksMotorsportGetStagesTool } from './get_stages' +export { sportmonksMotorsportGetStagesBySeasonTool } from './get_stages_by_season' +export { sportmonksMotorsportGetStateTool } from './get_state' +export { sportmonksMotorsportGetStatesTool } from './get_states' +export { sportmonksMotorsportGetStintsByFixtureTool } from './get_stints_by_fixture' +export { sportmonksMotorsportGetStintsByFixtureAndDriverTool } from './get_stints_by_fixture_and_driver' +export { sportmonksMotorsportGetStintsByFixtureAndStintTool } from './get_stints_by_fixture_and_stint' export { sportmonksMotorsportGetTeamTool } from './get_team' +export { sportmonksMotorsportGetTeamStandingsTool } from './get_team_standings' export { sportmonksMotorsportGetTeamStandingsBySeasonTool } from './get_team_standings_by_season' export { sportmonksMotorsportGetTeamsTool } from './get_teams' +export { sportmonksMotorsportGetTeamsByCountryTool } from './get_teams_by_country' +export { sportmonksMotorsportGetTeamsBySeasonTool } from './get_teams_by_season' +export { sportmonksMotorsportGetVenueTool } from './get_venue' +export { sportmonksMotorsportGetVenuesTool } from './get_venues' +export { sportmonksMotorsportGetVenuesBySeasonTool } from './get_venues_by_season' export { sportmonksMotorsportSearchDriversTool } from './search_drivers' +export { sportmonksMotorsportSearchLeaguesTool } from './search_leagues' +export { sportmonksMotorsportSearchStagesTool } from './search_stages' +export { sportmonksMotorsportSearchTeamsTool } from './search_teams' +export { sportmonksMotorsportSearchVenuesTool } from './search_venues' diff --git a/apps/sim/tools/sportmonks_motorsport/search_drivers.ts b/apps/sim/tools/sportmonks_motorsport/search_drivers.ts index 2680b01e0ff..d8e9a942f16 100644 --- a/apps/sim/tools/sportmonks_motorsport/search_drivers.ts +++ b/apps/sim/tools/sportmonks_motorsport/search_drivers.ts @@ -55,6 +55,12 @@ export const sportmonksMotorsportSearchDriversTool: ToolConfig< visibility: 'user-or-llm', description: 'Semicolon-separated relations to enrich the response (e.g. country;teams)', }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, per_page: { type: 'string', required: false, diff --git a/apps/sim/tools/sportmonks_motorsport/search_leagues.ts b/apps/sim/tools/sportmonks_motorsport/search_leagues.ts new file mode 100644 index 00000000000..83a85dd6957 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/search_leagues.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_LEAGUE_PROPERTIES, + type SportmonksMsLeague, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsSearchLeaguesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksMsSearchLeaguesResponse extends ToolResponse { + output: { + leagues: SportmonksMsLeague[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportSearchLeaguesTool: ToolConfig< + SportmonksMsSearchLeaguesParams, + SportmonksMsSearchLeaguesResponse +> = { + id: 'sportmonks_motorsport_search_leagues', + name: 'Search Leagues', + description: 'Search for motorsport leagues by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The league name to search for (e.g. Formula)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;seasons)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/leagues/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_leagues') + } + return { + success: true, + output: { + leagues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + leagues: { + type: 'array', + description: 'Array of league objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_MS_LEAGUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/search_stages.ts b/apps/sim/tools/sportmonks_motorsport/search_stages.ts new file mode 100644 index 00000000000..5aa917bdf86 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/search_stages.ts @@ -0,0 +1,116 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_STAGE_PROPERTIES, + type SportmonksMsStage, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsSearchStagesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksMsSearchStagesResponse extends ToolResponse { + output: { + stages: SportmonksMsStage[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportSearchStagesTool: ToolConfig< + SportmonksMsSearchStagesParams, + SportmonksMsSearchStagesResponse +> = { + id: 'sportmonks_motorsport_search_stages', + name: 'Search Stages', + description: 'Search for motorsport stages (race weekends) by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The stage name to search for (e.g. Monaco)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Semicolon-separated relations to enrich the response (e.g. league;season;fixtures)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/stages/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_stages') + } + return { + success: true, + output: { + stages: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + stages: { + type: 'array', + description: 'Array of stage (race weekend) objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_MS_STAGE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/search_teams.ts b/apps/sim/tools/sportmonks_motorsport/search_teams.ts new file mode 100644 index 00000000000..748903a1994 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/search_teams.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_TEAM_PROPERTIES, + type SportmonksMsTeam, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsSearchTeamsParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksMsSearchTeamsResponse extends ToolResponse { + output: { + teams: SportmonksMsTeam[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportSearchTeamsTool: ToolConfig< + SportmonksMsSearchTeamsParams, + SportmonksMsSearchTeamsResponse +> = { + id: 'sportmonks_motorsport_search_teams', + name: 'Search Teams', + description: 'Search for motorsport teams (constructors) by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The team name to search for (e.g. Bull)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;drivers)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/teams/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_teams') + } + return { + success: true, + output: { + teams: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + teams: { + type: 'array', + description: 'Array of team (constructor) objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_MS_TEAM_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/search_venues.ts b/apps/sim/tools/sportmonks_motorsport/search_venues.ts new file mode 100644 index 00000000000..16e2a038be6 --- /dev/null +++ b/apps/sim/tools/sportmonks_motorsport/search_venues.ts @@ -0,0 +1,115 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_MOTORSPORT_BASE_URL, + SPORTMONKS_MS_VENUE_PROPERTIES, + type SportmonksMsVenue, +} from '@/tools/sportmonks_motorsport/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksMsSearchVenuesParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + query: string +} + +export interface SportmonksMsSearchVenuesResponse extends ToolResponse { + output: { + venues: SportmonksMsVenue[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksMotorsportSearchVenuesTool: ToolConfig< + SportmonksMsSearchVenuesParams, + SportmonksMsSearchVenuesResponse +> = { + id: 'sportmonks_motorsport_search_venues', + name: 'Search Venues', + description: 'Search for motorsport venues (racing tracks) by name from Sportmonks', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + query: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The venue name to search for (e.g. Hungaroring)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. country;city)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/venues/search/${encodeURIComponent(params.query.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'search_venues') + } + return { + success: true, + output: { + venues: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + venues: { + type: 'array', + description: 'Array of venue (racing track) objects matching the search query', + items: { type: 'object', properties: SPORTMONKS_MS_VENUE_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_motorsport/types.ts b/apps/sim/tools/sportmonks_motorsport/types.ts index 51947e9e6ba..45a0d1b10e9 100644 --- a/apps/sim/tools/sportmonks_motorsport/types.ts +++ b/apps/sim/tools/sportmonks_motorsport/types.ts @@ -315,3 +315,259 @@ export interface SportmonksMsLap { participant_id: number is_latest: boolean } + +/** + * Output property definitions for a Stint object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/stint + */ +export const SPORTMONKS_MS_STINT_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the stint' }, + fixture_id: { type: 'number', description: 'Fixture related to the stint' }, + stint_number: { type: 'number', description: 'Stint number in the fixture' }, + driver_number: { type: 'number', description: 'Number of the driver' }, + participant_id: { type: 'number', description: 'Driver related to the stint' }, + is_latest: { type: 'boolean', description: 'Whether it is the latest stint' }, +} as const satisfies Record + +/** + * Output property definitions for a Venue (racing track) object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/venue + */ +export const SPORTMONKS_MS_VENUE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the venue (track)' }, + country_id: { type: 'number', description: 'Country the venue is in' }, + city_id: { + type: 'number', + description: 'City the venue is in', + nullable: true, + optional: true, + }, + name: { type: 'string', description: 'Name of the venue/track' }, + address: { type: 'string', description: 'Address of the venue', nullable: true }, + zipcode: { type: 'string', description: 'Zipcode of the venue', nullable: true }, + latitude: { type: 'string', description: 'Latitude of the venue', nullable: true }, + longitude: { type: 'string', description: 'Longitude of the venue', nullable: true }, + capacity: { type: 'number', description: 'Capacity of the venue', nullable: true }, + image_path: { + type: 'string', + description: 'URL to the track layout image', + nullable: true, + optional: true, + }, + city_name: { type: 'string', description: 'Name of the city the venue is in', nullable: true }, + surface: { type: 'string', description: 'Surface of the venue', nullable: true }, + national_team: { + type: 'boolean', + description: 'Not used in the Motorsport API', + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Motorsport League object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/league + */ +export const SPORTMONKS_MS_LEAGUE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the league' }, + sport_id: { type: 'number', description: 'Sport of the league' }, + country_id: { type: 'number', description: 'Country of the league' }, + name: { type: 'string', description: 'Name of the league' }, + active: { type: 'boolean', description: 'Whether the league is active' }, + short_code: { type: 'string', description: 'Short code of the league', nullable: true }, + image_path: { + type: 'string', + description: 'URL to the league logo', + nullable: true, + optional: true, + }, + type: { type: 'string', description: 'Type of the league', optional: true }, + sub_type: { + type: 'string', + description: 'Subtype of the league', + nullable: true, + optional: true, + }, + last_played_at: { + type: 'string', + description: 'Date of the last fixture held in the league', + nullable: true, + }, + category: { + type: 'number', + description: 'Category of the league', + nullable: true, + optional: true, + }, + has_jerseys: { + type: 'boolean', + description: 'Not used in the Motorsport API', + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Motorsport Season object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/season + */ +export const SPORTMONKS_MS_SEASON_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the season' }, + sport_id: { type: 'number', description: 'Sport of the season' }, + league_id: { type: 'number', description: 'League of the season' }, + tie_breaker_rule_id: { + type: 'number', + description: 'Not used in the Motorsport API', + nullable: true, + optional: true, + }, + name: { type: 'string', description: 'Name of the season' }, + finished: { type: 'boolean', description: 'Whether the season is finished' }, + pending: { type: 'boolean', description: 'Whether the season is pending' }, + is_current: { type: 'boolean', description: 'Whether the season is the current season' }, + starting_at: { type: 'string', description: 'Starting date of the season', nullable: true }, + ending_at: { type: 'string', description: 'Ending date of the season', nullable: true }, + standings_recalculated_at: { + type: 'string', + description: 'Timestamp when standings were last updated', + nullable: true, + optional: true, + }, + games_in_current_week: { + type: 'boolean', + description: 'Not used in the Motorsport API', + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Motorsport Stage (race weekend) object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/stage + */ +export const SPORTMONKS_MS_STAGE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the stage (race weekend)' }, + sport_id: { type: 'number', description: 'Sport of the stage' }, + league_id: { type: 'number', description: 'League related to the stage' }, + season_id: { type: 'number', description: 'Season related to the stage' }, + type_id: { type: 'number', description: 'Type of the stage', nullable: true }, + name: { type: 'string', description: 'Name of the stage' }, + sort_order: { + type: 'number', + description: 'Order of the stage', + nullable: true, + optional: true, + }, + finished: { type: 'boolean', description: 'Whether the stage is finished' }, + is_current: { type: 'boolean', description: 'Whether the stage is the current stage' }, + starting_at: { type: 'string', description: 'Starting date of the stage', nullable: true }, + ending_at: { type: 'string', description: 'Ending date of the stage', nullable: true }, + games_in_current_week: { + type: 'boolean', + description: 'Not used in the Motorsport API', + optional: true, + }, + tie_breaker_rule_id: { + type: 'number', + description: 'Not used in the Motorsport API', + nullable: true, + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Motorsport State (fixture status) object. + * @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/state + */ +export const SPORTMONKS_MS_STATE_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the state' }, + state: { type: 'string', description: 'Abbreviation of the state' }, + name: { type: 'string', description: 'Full name of the state' }, + short_name: { + type: 'string', + description: 'Short name of the state', + nullable: true, + optional: true, + }, + developer_name: { + type: 'string', + description: 'Name recommended for developers to use', + optional: true, + }, +} as const satisfies Record + +export interface SportmonksMsStint { + id: number + fixture_id: number + stint_number: number + driver_number: number + participant_id: number + is_latest: boolean +} + +export interface SportmonksMsVenue { + id: number + country_id: number + city_id?: number | null + name: string + address: string | null + zipcode: string | null + latitude: string | null + longitude: string | null + capacity: number | null + image_path?: string | null + city_name: string | null + surface: string | null + national_team?: boolean +} + +export interface SportmonksMsLeague { + id: number + sport_id: number + country_id: number + name: string + active: boolean + short_code: string | null + image_path?: string | null + type?: string + sub_type?: string | null + last_played_at: string | null + category?: number | null + has_jerseys?: boolean +} + +export interface SportmonksMsSeason { + id: number + sport_id: number + league_id: number + tie_breaker_rule_id?: number | null + name: string + finished: boolean + pending: boolean + is_current: boolean + starting_at: string | null + ending_at: string | null + standings_recalculated_at?: string | null + games_in_current_week?: boolean +} + +export interface SportmonksMsStage { + id: number + sport_id: number + league_id: number + season_id: number + type_id: number | null + name: string + sort_order?: number | null + finished: boolean + is_current: boolean + starting_at: string | null + ending_at: string | null + games_in_current_week?: boolean + tie_breaker_rule_id?: number | null +} + +export interface SportmonksMsState { + id: number + state: string + name: string + short_name?: string | null + developer_name?: string +} diff --git a/apps/sim/tools/sportmonks_odds/get_all_historical_odds.ts b/apps/sim/tools/sportmonks_odds/get_all_historical_odds.ts new file mode 100644 index 00000000000..35642860961 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_all_historical_odds.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_HISTORY_PROPERTIES, + type SportmonksPremiumOddHistory, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllHistoricalOddsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllHistoricalOddsResponse extends ToolResponse { + output: { + historicalOdds: SportmonksPremiumOddHistory[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetAllHistoricalOddsTool: ToolConfig< + SportmonksGetAllHistoricalOddsParams, + SportmonksGetAllHistoricalOddsResponse +> = { + id: 'sportmonks_odds_get_all_historical_odds', + name: 'Get All Historical Odds', + description: + 'Retrieve all available historical (premium) pre-match odd values from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. odd)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. winningOdds)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/history`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_historical_odds') + } + return { + success: true, + output: { + historicalOdds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + historicalOdds: { + type: 'array', + description: 'Array of historical premium odd value records', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_HISTORY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_all_inplay_odds.ts b/apps/sim/tools/sportmonks_odds/get_all_inplay_odds.ts new file mode 100644 index 00000000000..3ec84e013d0 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_all_inplay_odds.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_INPLAY_ODD_PROPERTIES, + type SportmonksInplayOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllInplayOddsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllInplayOddsResponse extends ToolResponse { + output: { + odds: SportmonksInplayOdd[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetAllInplayOddsTool: ToolConfig< + SportmonksGetAllInplayOddsParams, + SportmonksGetAllInplayOddsResponse +> = { + id: 'sportmonks_odds_get_all_inplay_odds', + name: 'Get All In-play Odds', + description: 'Retrieve all available live (in-play) odds from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12, bookmakers:2,14, IdAfter:oddID)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/inplay`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_inplay_odds') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of in-play odd objects', + items: { type: 'object', properties: SPORTMONKS_INPLAY_ODD_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_all_pre_match_odds.ts b/apps/sim/tools/sportmonks_odds/get_all_pre_match_odds.ts new file mode 100644 index 00000000000..cb60cfa77da --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_all_pre_match_odds.ts @@ -0,0 +1,106 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_ODD_PROPERTIES, + type SportmonksOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllPreMatchOddsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllPreMatchOddsResponse extends ToolResponse { + output: { + odds: SportmonksOdd[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetAllPreMatchOddsTool: ToolConfig< + SportmonksGetAllPreMatchOddsParams, + SportmonksGetAllPreMatchOddsResponse +> = { + id: 'sportmonks_odds_get_all_pre_match_odds', + name: 'Get All Pre-match Odds', + description: 'Retrieve all available pre-match odds from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: + 'Filters to apply (e.g. markets:1,12, bookmakers:2,14, winningOdds, IdAfter:oddID)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/pre-match`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_pre_match_odds') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of pre-match odd objects', + items: { type: 'object', properties: SPORTMONKS_ODD_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_all_premium_odds.ts b/apps/sim/tools/sportmonks_odds/get_all_premium_odds.ts new file mode 100644 index 00000000000..cb9250fd4a1 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_all_premium_odds.ts @@ -0,0 +1,105 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_PROPERTIES, + type SportmonksPremiumOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetAllPremiumOddsParams + extends SportmonksBaseParams, + SportmonksPaginationParams {} + +export interface SportmonksGetAllPremiumOddsResponse extends ToolResponse { + output: { + premiumOdds: SportmonksPremiumOdd[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetAllPremiumOddsTool: ToolConfig< + SportmonksGetAllPremiumOddsParams, + SportmonksGetAllPremiumOddsResponse +> = { + id: 'sportmonks_odds_get_all_premium_odds', + name: 'Get All Premium Odds', + description: + 'Retrieve all available premium (historical) pre-match odds from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12, bookmakers:2,14, IdAfter:oddID)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_all_premium_odds') + } + return { + success: true, + output: { + premiumOdds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + premiumOdds: { + type: 'array', + description: 'Array of premium odd objects', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_bookmaker_event_ids_by_fixture.ts b/apps/sim/tools/sportmonks_odds/get_bookmaker_event_ids_by_fixture.ts new file mode 100644 index 00000000000..b6f59054b29 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_bookmaker_event_ids_by_fixture.ts @@ -0,0 +1,104 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_BOOKMAKER_EVENT_PROPERTIES, + SPORTMONKS_ODDS_BASE_URL, + type SportmonksBookmakerEvent, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetBookmakerEventIdsByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetBookmakerEventIdsByFixtureResponse extends ToolResponse { + output: { + bookmakerEvents: SportmonksBookmakerEvent[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetBookmakerEventIdsByFixtureTool: ToolConfig< + SportmonksGetBookmakerEventIdsByFixtureParams, + SportmonksGetBookmakerEventIdsByFixtureResponse +> = { + id: 'sportmonks_odds_get_bookmaker_event_ids_by_fixture', + name: 'Get Bookmaker Event IDs by Fixture', + description: + "Retrieve bookmakers' own event ids mapped to a Sportmonks fixture via the Sportmonks Odds API", + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_ODDS_BASE_URL}/bookmakers/fixtures/${encodeURIComponent(params.fixtureId.trim())}/mapping` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_bookmaker_event_ids_by_fixture') + } + return { + success: true, + output: { + bookmakerEvents: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + bookmakerEvents: { + type: 'array', + description: 'Array of bookmaker event mapping records for the fixture', + items: { type: 'object', properties: SPORTMONKS_BOOKMAKER_EVENT_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_bookmakers_by_fixture.ts b/apps/sim/tools/sportmonks_odds/get_bookmakers_by_fixture.ts new file mode 100644 index 00000000000..8fa2123adce --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_bookmakers_by_fixture.ts @@ -0,0 +1,103 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_BOOKMAKER_PROPERTIES, + SPORTMONKS_ODDS_BASE_URL, + type SportmonksBookmaker, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetBookmakersByFixtureParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fixtureId: string +} + +export interface SportmonksGetBookmakersByFixtureResponse extends ToolResponse { + output: { + bookmakers: SportmonksBookmaker[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetBookmakersByFixtureTool: ToolConfig< + SportmonksGetBookmakersByFixtureParams, + SportmonksGetBookmakersByFixtureResponse +> = { + id: 'sportmonks_odds_get_bookmakers_by_fixture', + name: 'Get Bookmakers by Fixture', + description: 'Retrieve all bookmakers available for a fixture from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_ODDS_BASE_URL}/bookmakers/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_bookmakers_by_fixture') + } + return { + success: true, + output: { + bookmakers: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + bookmakers: { + type: 'array', + description: 'Array of bookmaker objects available for the fixture', + items: { type: 'object', properties: SPORTMONKS_BOOKMAKER_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture.ts b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture.ts index 72f610a6b93..5ee24da541e 100644 --- a/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture.ts +++ b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture.ts @@ -8,8 +8,8 @@ import { type SportmonksPaginationParams, } from '@/tools/sportmonks/types' import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, SPORTMONKS_INPLAY_ODD_PROPERTIES, - SPORTMONKS_ODDS_BASE_URL, type SportmonksInplayOdd, } from '@/tools/sportmonks_odds/types' import type { ToolConfig, ToolResponse } from '@/tools/types' @@ -84,7 +84,7 @@ export const sportmonksOddsGetInplayOddsByFixtureTool: ToolConfig< request: { url: (params) => { - const url = `${SPORTMONKS_ODDS_BASE_URL}/inplay/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/inplay/fixtures/${encodeURIComponent(params.fixtureId.trim())}` return appendSportmonksQuery(url, params) }, method: 'GET', diff --git a/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_bookmaker.ts b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_bookmaker.ts new file mode 100644 index 00000000000..fb38e24ab35 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_bookmaker.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_INPLAY_ODD_PROPERTIES, + type SportmonksInplayOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetInplayOddsByFixtureAndBookmakerParams extends SportmonksBaseParams { + fixtureId: string + bookmakerId: string +} + +export interface SportmonksGetInplayOddsByFixtureAndBookmakerResponse extends ToolResponse { + output: { + odds: SportmonksInplayOdd[] + } +} + +export const sportmonksOddsGetInplayOddsByFixtureAndBookmakerTool: ToolConfig< + SportmonksGetInplayOddsByFixtureAndBookmakerParams, + SportmonksGetInplayOddsByFixtureAndBookmakerResponse +> = { + id: 'sportmonks_odds_get_inplay_odds_by_fixture_and_bookmaker', + name: 'Get In-play Odds by Fixture and Bookmaker', + description: + 'Retrieve live (in-play) odds for a fixture from a specific bookmaker via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + bookmakerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the bookmaker', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/inplay/fixtures/${encodeURIComponent(params.fixtureId.trim())}/bookmakers/${encodeURIComponent(params.bookmakerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_inplay_odds_by_fixture_and_bookmaker') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of in-play odd objects for the fixture and bookmaker', + items: { type: 'object', properties: SPORTMONKS_INPLAY_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_market.ts b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_market.ts new file mode 100644 index 00000000000..ca207ee94ac --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_inplay_odds_by_fixture_and_market.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_INPLAY_ODD_PROPERTIES, + type SportmonksInplayOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetInplayOddsByFixtureAndMarketParams extends SportmonksBaseParams { + fixtureId: string + marketId: string +} + +export interface SportmonksGetInplayOddsByFixtureAndMarketResponse extends ToolResponse { + output: { + odds: SportmonksInplayOdd[] + } +} + +export const sportmonksOddsGetInplayOddsByFixtureAndMarketTool: ToolConfig< + SportmonksGetInplayOddsByFixtureAndMarketParams, + SportmonksGetInplayOddsByFixtureAndMarketResponse +> = { + id: 'sportmonks_odds_get_inplay_odds_by_fixture_and_market', + name: 'Get In-play Odds by Fixture and Market', + description: + 'Retrieve live (in-play) odds for a fixture on a specific market via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + marketId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the market', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. bookmakers:2,14)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/inplay/fixtures/${encodeURIComponent(params.fixtureId.trim())}/markets/${encodeURIComponent(params.marketId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_inplay_odds_by_fixture_and_market') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of in-play odd objects for the fixture and market', + items: { type: 'object', properties: SPORTMONKS_INPLAY_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_last_updated_inplay_odds.ts b/apps/sim/tools/sportmonks_odds/get_last_updated_inplay_odds.ts new file mode 100644 index 00000000000..f6c5e196ff3 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_last_updated_inplay_odds.ts @@ -0,0 +1,79 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_INPLAY_ODD_PROPERTIES, + type SportmonksInplayOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLastUpdatedInplayOddsParams extends SportmonksBaseParams {} + +export interface SportmonksGetLastUpdatedInplayOddsResponse extends ToolResponse { + output: { + odds: SportmonksInplayOdd[] + } +} + +export const sportmonksOddsGetLastUpdatedInplayOddsTool: ToolConfig< + SportmonksGetLastUpdatedInplayOddsParams, + SportmonksGetLastUpdatedInplayOddsResponse +> = { + id: 'sportmonks_odds_get_last_updated_inplay_odds', + name: 'Get Last Updated In-play Odds', + description: 'Retrieve in-play odds updated in the last 10 seconds from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12 or bookmakers:2,14)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/inplay/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_last_updated_inplay_odds') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of in-play odd objects updated in the last 10 seconds', + items: { type: 'object', properties: SPORTMONKS_INPLAY_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_last_updated_pre_match_odds.ts b/apps/sim/tools/sportmonks_odds/get_last_updated_pre_match_odds.ts new file mode 100644 index 00000000000..9f48ef582fe --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_last_updated_pre_match_odds.ts @@ -0,0 +1,80 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_ODD_PROPERTIES, + type SportmonksOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetLastUpdatedPreMatchOddsParams extends SportmonksBaseParams {} + +export interface SportmonksGetLastUpdatedPreMatchOddsResponse extends ToolResponse { + output: { + odds: SportmonksOdd[] + } +} + +export const sportmonksOddsGetLastUpdatedPreMatchOddsTool: ToolConfig< + SportmonksGetLastUpdatedPreMatchOddsParams, + SportmonksGetLastUpdatedPreMatchOddsResponse +> = { + id: 'sportmonks_odds_get_last_updated_pre_match_odds', + name: 'Get Last Updated Pre-match Odds', + description: + 'Retrieve pre-match odds updated in the last 10 seconds from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12 or bookmakers:2,14 or winningOdds)', + }, + }, + + request: { + url: (params) => + appendSportmonksQuery(`${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/pre-match/latest`, params), + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_last_updated_pre_match_odds') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of pre-match odd objects updated in the last 10 seconds', + items: { type: 'object', properties: SPORTMONKS_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture.ts b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture.ts index f769d06bf63..9b9df64361f 100644 --- a/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture.ts +++ b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture.ts @@ -8,8 +8,8 @@ import { type SportmonksPaginationParams, } from '@/tools/sportmonks/types' import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, SPORTMONKS_ODD_PROPERTIES, - SPORTMONKS_ODDS_BASE_URL, type SportmonksOdd, } from '@/tools/sportmonks_odds/types' import type { ToolConfig, ToolResponse } from '@/tools/types' @@ -83,7 +83,7 @@ export const sportmonksOddsGetPreMatchOddsByFixtureTool: ToolConfig< request: { url: (params) => { - const url = `${SPORTMONKS_ODDS_BASE_URL}/pre-match/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/pre-match/fixtures/${encodeURIComponent(params.fixtureId.trim())}` return appendSportmonksQuery(url, params) }, method: 'GET', diff --git a/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_bookmaker.ts b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_bookmaker.ts new file mode 100644 index 00000000000..9c0838194f5 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_bookmaker.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_ODD_PROPERTIES, + type SportmonksOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPreMatchOddsByFixtureAndBookmakerParams extends SportmonksBaseParams { + fixtureId: string + bookmakerId: string +} + +export interface SportmonksGetPreMatchOddsByFixtureAndBookmakerResponse extends ToolResponse { + output: { + odds: SportmonksOdd[] + } +} + +export const sportmonksOddsGetPreMatchOddsByFixtureAndBookmakerTool: ToolConfig< + SportmonksGetPreMatchOddsByFixtureAndBookmakerParams, + SportmonksGetPreMatchOddsByFixtureAndBookmakerResponse +> = { + id: 'sportmonks_odds_get_pre_match_odds_by_fixture_and_bookmaker', + name: 'Get Pre-match Odds by Fixture and Bookmaker', + description: + 'Retrieve pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + bookmakerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the bookmaker', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12 or winningOdds)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/pre-match/fixtures/${encodeURIComponent(params.fixtureId.trim())}/bookmakers/${encodeURIComponent(params.bookmakerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_pre_match_odds_by_fixture_and_bookmaker') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of pre-match odd objects for the fixture and bookmaker', + items: { type: 'object', properties: SPORTMONKS_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_market.ts b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_market.ts new file mode 100644 index 00000000000..5e57b824ae4 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_pre_match_odds_by_fixture_and_market.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_ODD_PROPERTIES, + type SportmonksOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPreMatchOddsByFixtureAndMarketParams extends SportmonksBaseParams { + fixtureId: string + marketId: string +} + +export interface SportmonksGetPreMatchOddsByFixtureAndMarketResponse extends ToolResponse { + output: { + odds: SportmonksOdd[] + } +} + +export const sportmonksOddsGetPreMatchOddsByFixtureAndMarketTool: ToolConfig< + SportmonksGetPreMatchOddsByFixtureAndMarketParams, + SportmonksGetPreMatchOddsByFixtureAndMarketResponse +> = { + id: 'sportmonks_odds_get_pre_match_odds_by_fixture_and_market', + name: 'Get Pre-match Odds by Fixture and Market', + description: + 'Retrieve pre-match odds for a fixture on a specific market via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + marketId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the market', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. bookmakers:2,14 or winningOdds)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/pre-match/fixtures/${encodeURIComponent(params.fixtureId.trim())}/markets/${encodeURIComponent(params.marketId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_pre_match_odds_by_fixture_and_market') + } + return { + success: true, + output: { + odds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + odds: { + type: 'array', + description: 'Array of pre-match odd objects for the fixture and market', + items: { type: 'object', properties: SPORTMONKS_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture.ts b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture.ts new file mode 100644 index 00000000000..faa9ca446a0 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture.ts @@ -0,0 +1,90 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_PROPERTIES, + type SportmonksPremiumOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPremiumOddsByFixtureParams extends SportmonksBaseParams { + fixtureId: string +} + +export interface SportmonksGetPremiumOddsByFixtureResponse extends ToolResponse { + output: { + premiumOdds: SportmonksPremiumOdd[] + } +} + +export const sportmonksOddsGetPremiumOddsByFixtureTool: ToolConfig< + SportmonksGetPremiumOddsByFixtureParams, + SportmonksGetPremiumOddsByFixtureResponse +> = { + id: 'sportmonks_odds_get_premium_odds_by_fixture', + name: 'Get Premium Odds by Fixture', + description: + 'Retrieve premium (historical) pre-match odds for a fixture from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12 or bookmakers:2,14)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/fixtures/${encodeURIComponent(params.fixtureId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_premium_odds_by_fixture') + } + return { + success: true, + output: { + premiumOdds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + premiumOdds: { + type: 'array', + description: 'Array of premium odd objects for the fixture', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_bookmaker.ts b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_bookmaker.ts new file mode 100644 index 00000000000..e288eeb08b9 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_bookmaker.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_PROPERTIES, + type SportmonksPremiumOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPremiumOddsByFixtureAndBookmakerParams extends SportmonksBaseParams { + fixtureId: string + bookmakerId: string +} + +export interface SportmonksGetPremiumOddsByFixtureAndBookmakerResponse extends ToolResponse { + output: { + premiumOdds: SportmonksPremiumOdd[] + } +} + +export const sportmonksOddsGetPremiumOddsByFixtureAndBookmakerTool: ToolConfig< + SportmonksGetPremiumOddsByFixtureAndBookmakerParams, + SportmonksGetPremiumOddsByFixtureAndBookmakerResponse +> = { + id: 'sportmonks_odds_get_premium_odds_by_fixture_and_bookmaker', + name: 'Get Premium Odds by Fixture and Bookmaker', + description: + 'Retrieve premium pre-match odds for a fixture from a specific bookmaker via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + bookmakerId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the bookmaker', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/fixtures/${encodeURIComponent(params.fixtureId.trim())}/bookmakers/${encodeURIComponent(params.bookmakerId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_premium_odds_by_fixture_and_bookmaker') + } + return { + success: true, + output: { + premiumOdds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + premiumOdds: { + type: 'array', + description: 'Array of premium odd objects for the fixture and bookmaker', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_market.ts b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_market.ts new file mode 100644 index 00000000000..46ffa8c7851 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_premium_odds_by_fixture_and_market.ts @@ -0,0 +1,97 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + type SportmonksBaseParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_PROPERTIES, + type SportmonksPremiumOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetPremiumOddsByFixtureAndMarketParams extends SportmonksBaseParams { + fixtureId: string + marketId: string +} + +export interface SportmonksGetPremiumOddsByFixtureAndMarketResponse extends ToolResponse { + output: { + premiumOdds: SportmonksPremiumOdd[] + } +} + +export const sportmonksOddsGetPremiumOddsByFixtureAndMarketTool: ToolConfig< + SportmonksGetPremiumOddsByFixtureAndMarketParams, + SportmonksGetPremiumOddsByFixtureAndMarketResponse +> = { + id: 'sportmonks_odds_get_premium_odds_by_fixture_and_market', + name: 'Get Premium Odds by Fixture and Market', + description: + 'Retrieve premium pre-match odds for a fixture on a specific market via the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fixtureId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the fixture', + }, + marketId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The unique id of the market', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. bookmakers:2,14)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/fixtures/${encodeURIComponent(params.fixtureId.trim())}/markets/${encodeURIComponent(params.marketId.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_premium_odds_by_fixture_and_market') + } + return { + success: true, + output: { + premiumOdds: Array.isArray(data.data) ? data.data : [], + }, + } + }, + + outputs: { + premiumOdds: { + type: 'array', + description: 'Array of premium odd objects for the fixture and market', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_PROPERTIES }, + }, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_updated_historical_odds_between.ts b/apps/sim/tools/sportmonks_odds/get_updated_historical_odds_between.ts new file mode 100644 index 00000000000..77cd07bf0fd --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_updated_historical_odds_between.ts @@ -0,0 +1,123 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_HISTORY_PROPERTIES, + type SportmonksPremiumOddHistory, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetUpdatedHistoricalOddsBetweenParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fromTimestamp: string + toTimestamp: string +} + +export interface SportmonksGetUpdatedHistoricalOddsBetweenResponse extends ToolResponse { + output: { + historicalOdds: SportmonksPremiumOddHistory[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetUpdatedHistoricalOddsBetweenTool: ToolConfig< + SportmonksGetUpdatedHistoricalOddsBetweenParams, + SportmonksGetUpdatedHistoricalOddsBetweenResponse +> = { + id: 'sportmonks_odds_get_updated_historical_odds_between', + name: 'Get Updated Historical Odds Between Time Range', + description: + 'Retrieve historical (premium) odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fromTimestamp: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start of the range as a UNIX timestamp (e.g. 1767225600)', + }, + toTimestamp: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End of the range as a UNIX timestamp (max 5 minutes after the start)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. odd)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. winningOdds)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/history/updated/between/${encodeURIComponent(params.fromTimestamp.trim())}/${encodeURIComponent(params.toTimestamp.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_updated_historical_odds_between') + } + return { + success: true, + output: { + historicalOdds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + historicalOdds: { + type: 'array', + description: 'Array of historical premium odd value records updated within the time range', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_HISTORY_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/get_updated_premium_odds_between.ts b/apps/sim/tools/sportmonks_odds/get_updated_premium_odds_between.ts new file mode 100644 index 00000000000..f12156812a3 --- /dev/null +++ b/apps/sim/tools/sportmonks_odds/get_updated_premium_odds_between.ts @@ -0,0 +1,123 @@ +import { + appendSportmonksQuery, + buildSportmonksHeaders, + handleSportmonksError, + SPORTMONKS_PAGINATION_OUTPUT, + type SportmonksBaseParams, + type SportmonksPagination, + type SportmonksPaginationParams, +} from '@/tools/sportmonks/types' +import { + SPORTMONKS_FOOTBALL_ODDS_BASE_URL, + SPORTMONKS_PREMIUM_ODD_PROPERTIES, + type SportmonksPremiumOdd, +} from '@/tools/sportmonks_odds/types' +import type { ToolConfig, ToolResponse } from '@/tools/types' + +export interface SportmonksGetUpdatedPremiumOddsBetweenParams + extends SportmonksBaseParams, + SportmonksPaginationParams { + fromTimestamp: string + toTimestamp: string +} + +export interface SportmonksGetUpdatedPremiumOddsBetweenResponse extends ToolResponse { + output: { + premiumOdds: SportmonksPremiumOdd[] + pagination?: SportmonksPagination | null + } +} + +export const sportmonksOddsGetUpdatedPremiumOddsBetweenTool: ToolConfig< + SportmonksGetUpdatedPremiumOddsBetweenParams, + SportmonksGetUpdatedPremiumOddsBetweenResponse +> = { + id: 'sportmonks_odds_get_updated_premium_odds_between', + name: 'Get Updated Premium Odds Between Time Range', + description: + 'Retrieve premium odds updated between two UNIX timestamps (max 5 minutes) from the Sportmonks Odds API', + version: '1.0.0', + + params: { + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Sportmonks API token', + }, + fromTimestamp: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Start of the range as a UNIX timestamp (e.g. 1767225600)', + }, + toTimestamp: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'End of the range as a UNIX timestamp (max 5 minutes after the start)', + }, + include: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Semicolon-separated relations to enrich the response (e.g. market;bookmaker)', + }, + filters: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Filters to apply (e.g. markets:1,12 or bookmakers:2,14)', + }, + per_page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Number of results per page (max 50, default 25)', + }, + page: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Page number to retrieve', + }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, + }, + + request: { + url: (params) => { + const url = `${SPORTMONKS_FOOTBALL_ODDS_BASE_URL}/premium/updated/between/${encodeURIComponent(params.fromTimestamp.trim())}/${encodeURIComponent(params.toTimestamp.trim())}` + return appendSportmonksQuery(url, params) + }, + method: 'GET', + headers: (params) => buildSportmonksHeaders(params.apiKey), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + if (!response.ok) { + handleSportmonksError(data, response.status, 'get_updated_premium_odds_between') + } + return { + success: true, + output: { + premiumOdds: Array.isArray(data.data) ? data.data : [], + pagination: data.pagination ?? null, + }, + } + }, + + outputs: { + premiumOdds: { + type: 'array', + description: 'Array of premium odd objects updated within the time range', + items: { type: 'object', properties: SPORTMONKS_PREMIUM_ODD_PROPERTIES }, + }, + pagination: SPORTMONKS_PAGINATION_OUTPUT, + }, +} diff --git a/apps/sim/tools/sportmonks_odds/index.ts b/apps/sim/tools/sportmonks_odds/index.ts index ec81b21556e..105a5f151c0 100644 --- a/apps/sim/tools/sportmonks_odds/index.ts +++ b/apps/sim/tools/sportmonks_odds/index.ts @@ -1,8 +1,25 @@ +export { sportmonksOddsGetAllHistoricalOddsTool } from './get_all_historical_odds' +export { sportmonksOddsGetAllInplayOddsTool } from './get_all_inplay_odds' +export { sportmonksOddsGetAllPreMatchOddsTool } from './get_all_pre_match_odds' +export { sportmonksOddsGetAllPremiumOddsTool } from './get_all_premium_odds' export { sportmonksOddsGetBookmakerTool } from './get_bookmaker' +export { sportmonksOddsGetBookmakerEventIdsByFixtureTool } from './get_bookmaker_event_ids_by_fixture' export { sportmonksOddsGetBookmakersTool } from './get_bookmakers' +export { sportmonksOddsGetBookmakersByFixtureTool } from './get_bookmakers_by_fixture' export { sportmonksOddsGetInplayOddsByFixtureTool } from './get_inplay_odds_by_fixture' +export { sportmonksOddsGetInplayOddsByFixtureAndBookmakerTool } from './get_inplay_odds_by_fixture_and_bookmaker' +export { sportmonksOddsGetInplayOddsByFixtureAndMarketTool } from './get_inplay_odds_by_fixture_and_market' +export { sportmonksOddsGetLastUpdatedInplayOddsTool } from './get_last_updated_inplay_odds' +export { sportmonksOddsGetLastUpdatedPreMatchOddsTool } from './get_last_updated_pre_match_odds' export { sportmonksOddsGetMarketTool } from './get_market' export { sportmonksOddsGetMarketsTool } from './get_markets' export { sportmonksOddsGetPreMatchOddsByFixtureTool } from './get_pre_match_odds_by_fixture' +export { sportmonksOddsGetPreMatchOddsByFixtureAndBookmakerTool } from './get_pre_match_odds_by_fixture_and_bookmaker' +export { sportmonksOddsGetPreMatchOddsByFixtureAndMarketTool } from './get_pre_match_odds_by_fixture_and_market' +export { sportmonksOddsGetPremiumOddsByFixtureTool } from './get_premium_odds_by_fixture' +export { sportmonksOddsGetPremiumOddsByFixtureAndBookmakerTool } from './get_premium_odds_by_fixture_and_bookmaker' +export { sportmonksOddsGetPremiumOddsByFixtureAndMarketTool } from './get_premium_odds_by_fixture_and_market' +export { sportmonksOddsGetUpdatedHistoricalOddsBetweenTool } from './get_updated_historical_odds_between' +export { sportmonksOddsGetUpdatedPremiumOddsBetweenTool } from './get_updated_premium_odds_between' export { sportmonksOddsSearchBookmakersTool } from './search_bookmakers' export { sportmonksOddsSearchMarketsTool } from './search_markets' diff --git a/apps/sim/tools/sportmonks_odds/search_bookmakers.ts b/apps/sim/tools/sportmonks_odds/search_bookmakers.ts index dc03a8fafff..80ac35f4059 100644 --- a/apps/sim/tools/sportmonks_odds/search_bookmakers.ts +++ b/apps/sim/tools/sportmonks_odds/search_bookmakers.ts @@ -61,6 +61,12 @@ export const sportmonksOddsSearchBookmakersTool: ToolConfig< visibility: 'user-or-llm', description: 'Page number to retrieve', }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, }, request: { diff --git a/apps/sim/tools/sportmonks_odds/search_markets.ts b/apps/sim/tools/sportmonks_odds/search_markets.ts index dd85ef536e7..a76c4393d20 100644 --- a/apps/sim/tools/sportmonks_odds/search_markets.ts +++ b/apps/sim/tools/sportmonks_odds/search_markets.ts @@ -61,6 +61,12 @@ export const sportmonksOddsSearchMarketsTool: ToolConfig< visibility: 'user-or-llm', description: 'Page number to retrieve', }, + order: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'Order direction (asc or desc)', + }, }, request: { diff --git a/apps/sim/tools/sportmonks_odds/types.ts b/apps/sim/tools/sportmonks_odds/types.ts index 90fbdadf7ab..4cb65784984 100644 --- a/apps/sim/tools/sportmonks_odds/types.ts +++ b/apps/sim/tools/sportmonks_odds/types.ts @@ -1,11 +1,22 @@ import type { OutputProperty } from '@/tools/types' /** - * Base URL for the Sportmonks Odds API v3. - * @see https://docs.sportmonks.com/v3/odds-api/getting-started/welcome + * Base URL for the shared Sportmonks Odds reference resources (bookmakers and + * markets). These live under the sport-agnostic `/v3/odds` path. + * @see https://docs.sportmonks.com/v3/odds-api/getting-started/endpoints/bookmakers/get-all-bookmakers + * @see https://docs.sportmonks.com/v3/odds-api/getting-started/endpoints/markets/get-all-markets */ export const SPORTMONKS_ODDS_BASE_URL = 'https://api.sportmonks.com/v3/odds' +/** + * Base URL for the Sportmonks football odds feeds (pre-match and in-play odds by + * fixture). Unlike bookmakers/markets, these endpoints are sport-scoped and live + * under the `/v3/football/odds` path. + * @see https://docs.sportmonks.com/v3/odds-api/getting-started/endpoints/pre-match-odds/get-odds-by-fixture-id + * @see https://docs.sportmonks.com/v3/odds-api/getting-started/endpoints/inplay-odds/get-odds-by-fixture-id + */ +export const SPORTMONKS_FOOTBALL_ODDS_BASE_URL = 'https://api.sportmonks.com/v3/football/odds' + /** * Output property definitions for a pre-match Odd object. * @see https://docs.sportmonks.com/v3/odds-api/getting-started/entities/odd @@ -84,6 +95,12 @@ export const SPORTMONKS_ODD_PROPERTIES = { nullable: true, optional: true, }, + original_label: { + type: 'string', + description: 'Original handicap value of the odd (handicap markets)', + nullable: true, + optional: true, + }, } as const satisfies Record /** @@ -173,6 +190,129 @@ export const SPORTMONKS_INPLAY_ODD_PROPERTIES = { }, } as const satisfies Record +/** + * Output property definitions for a Premium Odd object. Premium odds carry + * created/updated timestamps and do not yet expose winning calculations. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/premium-odds-feed/premium-pre-match-odds/get-all-premium-odds + */ +export const SPORTMONKS_PREMIUM_ODD_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the odd' }, + fixture_id: { type: 'number', description: 'Fixture the odd belongs to' }, + market_id: { type: 'number', description: 'Market the odd belongs to' }, + bookmaker_id: { type: 'number', description: 'Bookmaker offering the odd' }, + label: { type: 'string', description: 'Outcome label', nullable: true }, + value: { type: 'string', description: 'Decimal odds value', nullable: true }, + name: { type: 'string', description: 'Outcome name', nullable: true }, + sort_order: { + type: 'number', + description: 'Sort order of the odd', + nullable: true, + optional: true, + }, + market_description: { + type: 'string', + description: 'Description of the market', + nullable: true, + optional: true, + }, + probability: { + type: 'string', + description: 'Implied probability (e.g. 29.85%)', + nullable: true, + optional: true, + }, + dp3: { + type: 'string', + description: 'Decimal odds to 3 decimal places', + nullable: true, + optional: true, + }, + fractional: { type: 'string', description: 'Fractional odds', nullable: true, optional: true }, + american: { + type: 'string', + description: 'American/moneyline odds', + nullable: true, + optional: true, + }, + stopped: { + type: 'boolean', + description: 'Whether the odd is stopped', + nullable: true, + optional: true, + }, + total: { + type: 'string', + description: 'Total line for over/under markets', + nullable: true, + optional: true, + }, + handicap: { + type: 'string', + description: 'Handicap line for handicap markets', + nullable: true, + optional: true, + }, + created_at: { + type: 'string', + description: 'Timestamp the odd was created (UTC)', + nullable: true, + optional: true, + }, + updated_at: { + type: 'string', + description: 'Timestamp the odd was last updated (UTC)', + nullable: true, + optional: true, + }, + latest_bookmaker_update: { + type: 'string', + description: "Bookmaker's own last-update timestamp (UTC)", + nullable: true, + optional: true, + }, +} as const satisfies Record + +/** + * Output property definitions for a Premium Odd history record. Each record is a + * historical value of a premium odd referenced by `odd_id`. + * @see https://docs.sportmonks.com/v3/endpoints-and-entities/endpoints/premium-odds-feed/premium-pre-match-odds/get-all-historical-odds + */ +export const SPORTMONKS_PREMIUM_ODD_HISTORY_PROPERTIES = { + id: { type: 'number', description: 'Unique id of the history record' }, + odd_id: { type: 'number', description: 'Premium odd this history record belongs to' }, + value: { + type: 'string', + description: 'Historical decimal odds value', + nullable: true, + optional: true, + }, + probability: { + type: 'string', + description: 'Implied probability at this point in time', + nullable: true, + optional: true, + }, + dp3: { + type: 'string', + description: 'Decimal odds to 3 decimal places', + nullable: true, + optional: true, + }, + fractional: { type: 'string', description: 'Fractional odds', nullable: true, optional: true }, + american: { + type: 'string', + description: 'American/moneyline odds', + nullable: true, + optional: true, + }, + bookmaker_update: { + type: 'string', + description: "Bookmaker's update timestamp for this record (UTC)", + nullable: true, + optional: true, + }, +} as const satisfies Record + /** * Output property definitions for a Bookmaker object. * @see https://docs.sportmonks.com/v3/odds-api/getting-started/entities/bookmaker @@ -183,6 +323,29 @@ export const SPORTMONKS_BOOKMAKER_PROPERTIES = { logo: { type: 'string', description: 'Logo of the bookmaker', nullable: true, optional: true }, } as const satisfies Record +/** + * Output property definitions for a bookmaker event mapping record, returned by + * the "bookmaker event ids by fixture" endpoint. Maps a Sportmonks fixture to a + * bookmaker's own event id. + * @see https://docs.sportmonks.com/v3/odds-api/getting-started/endpoints/bookmakers/get-bookmaker-event-ids-by-fixture-id + */ +export const SPORTMONKS_BOOKMAKER_EVENT_PROPERTIES = { + fixture_id: { type: 'number', description: 'Sportmonks fixture id' }, + bookmaker_id: { type: 'number', description: 'Id of the bookmaker' }, + bookmaker_name: { + type: 'string', + description: 'Name of the bookmaker', + nullable: true, + optional: true, + }, + bookmaker_event_id: { + type: 'string', + description: "The fixture's event id at the bookmaker", + nullable: true, + optional: true, + }, +} as const satisfies Record + /** * Output property definitions for a Market object. * @see https://docs.sportmonks.com/v3/odds-api/getting-started/entities/market @@ -190,6 +353,12 @@ export const SPORTMONKS_BOOKMAKER_PROPERTIES = { export const SPORTMONKS_MARKET_PROPERTIES = { id: { type: 'number', description: 'Unique id of the market' }, name: { type: 'string', description: 'Name of the market' }, + developer_name: { + type: 'string', + description: 'Developer (machine-readable) name of the market', + nullable: true, + optional: true, + }, } as const satisfies Record export interface SportmonksOdd { @@ -211,6 +380,7 @@ export interface SportmonksOdd { total?: string | null handicap?: string | null participants?: string | null + original_label?: string | null } export interface SportmonksInplayOdd extends SportmonksOdd { @@ -218,13 +388,54 @@ export interface SportmonksInplayOdd extends SportmonksOdd { suspended?: boolean | null } +export interface SportmonksPremiumOdd { + id: number + fixture_id: number + market_id: number + bookmaker_id: number + label: string | null + value: string | null + name: string | null + sort_order?: number | null + market_description?: string | null + probability?: string | null + dp3?: string | null + fractional?: string | null + american?: string | null + stopped?: boolean | null + total?: string | null + handicap?: string | null + created_at?: string | null + updated_at?: string | null + latest_bookmaker_update?: string | null +} + +export interface SportmonksPremiumOddHistory { + id: number + odd_id: number + value?: string | null + probability?: string | null + dp3?: string | null + fractional?: string | null + american?: string | null + bookmaker_update?: string | null +} + export interface SportmonksBookmaker { id: number name: string logo?: string | null } +export interface SportmonksBookmakerEvent { + fixture_id: number + bookmaker_id: number + bookmaker_name?: string | null + bookmaker_event_id?: string | null +} + export interface SportmonksMarket { id: number name: string + developer_name?: string | null }