chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import {
|
||||
appendSportmonksQuery,
|
||||
buildSportmonksHeaders,
|
||||
handleSportmonksError,
|
||||
type SportmonksBaseParams,
|
||||
} 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 SportmonksMsGetDriverParams extends SportmonksBaseParams {
|
||||
driverId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetDriverResponse extends ToolResponse {
|
||||
output: {
|
||||
driver: SportmonksMsDriver | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetDriverTool: ToolConfig<
|
||||
SportmonksMsGetDriverParams,
|
||||
SportmonksMsGetDriverResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_driver',
|
||||
name: 'Get Driver by ID',
|
||||
description: 'Retrieve a single motorsport driver by their ID from Sportmonks',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Sportmonks API token',
|
||||
},
|
||||
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. country;teams)',
|
||||
},
|
||||
filters: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filters to apply',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/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_driver')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
driver: data.data ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
driver: {
|
||||
type: 'object',
|
||||
description: 'The requested driver object',
|
||||
properties: SPORTMONKS_MS_DRIVER_PROPERTIES,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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_STANDING_PROPERTIES,
|
||||
type SportmonksMsStanding,
|
||||
} from '@/tools/sportmonks_motorsport/types'
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface SportmonksMsGetDriverStandingsParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {
|
||||
seasonId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetDriverStandingsResponse extends ToolResponse {
|
||||
output: {
|
||||
standings: SportmonksMsStanding[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetDriverStandingsBySeasonTool: ToolConfig<
|
||||
SportmonksMsGetDriverStandingsParams,
|
||||
SportmonksMsGetDriverStandingsResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_driver_standings_by_season',
|
||||
name: 'Get Driver Standings by Season',
|
||||
description:
|
||||
'Retrieve the drivers championship standings 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. 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) => {
|
||||
const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/standings/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_driver_standings_by_season')
|
||||
}
|
||||
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 for the season',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_STANDING_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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_DRIVER_PROPERTIES,
|
||||
type SportmonksMsDriver,
|
||||
} from '@/tools/sportmonks_motorsport/types'
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface SportmonksMsGetDriversParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {}
|
||||
|
||||
export interface SportmonksMsGetDriversResponse extends ToolResponse {
|
||||
output: {
|
||||
drivers: SportmonksMsDriver[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetDriversTool: ToolConfig<
|
||||
SportmonksMsGetDriversParams,
|
||||
SportmonksMsGetDriversResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_drivers',
|
||||
name: 'Get Drivers',
|
||||
description: 'Retrieve all 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`, 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')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
drivers: Array.isArray(data.data) ? data.data : [],
|
||||
pagination: data.pagination ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
drivers: {
|
||||
type: 'array',
|
||||
description: 'Array of driver objects',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_DRIVER_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import {
|
||||
appendSportmonksQuery,
|
||||
buildSportmonksHeaders,
|
||||
handleSportmonksError,
|
||||
type SportmonksBaseParams,
|
||||
} 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 SportmonksMsGetFixtureParams extends SportmonksBaseParams {
|
||||
fixtureId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetFixtureResponse extends ToolResponse {
|
||||
output: {
|
||||
fixture: SportmonksMsFixture | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetFixtureTool: ToolConfig<
|
||||
SportmonksMsGetFixtureParams,
|
||||
SportmonksMsGetFixtureResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_fixture',
|
||||
name: 'Get Motorsport Fixture by ID',
|
||||
description: 'Retrieve a single motorsport fixture (session) by its 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. participants;results;latestLaps;pitstops)',
|
||||
},
|
||||
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())}`
|
||||
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_fixture')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fixture: data.data ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fixture: {
|
||||
type: 'object',
|
||||
description: 'The requested motorsport fixture (session) object',
|
||||
properties: SPORTMONKS_MS_FIXTURE_PROPERTIES,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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_FIXTURE_PROPERTIES,
|
||||
type SportmonksMsFixture,
|
||||
} from '@/tools/sportmonks_motorsport/types'
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface SportmonksMsGetFixturesByDateParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {
|
||||
date: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetFixturesByDateResponse extends ToolResponse {
|
||||
output: {
|
||||
fixtures: SportmonksMsFixture[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetFixturesByDateTool: ToolConfig<
|
||||
SportmonksMsGetFixturesByDateParams,
|
||||
SportmonksMsGetFixturesByDateResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_fixtures_by_date',
|
||||
name: 'Get Motorsport Fixtures by Date',
|
||||
description:
|
||||
'Retrieve motorsport fixtures (sessions) 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 fixtures 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. 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/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_fixtures_by_date')
|
||||
}
|
||||
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 date',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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 SportmonksMsGetLapsByFixtureParams extends SportmonksBaseParams {
|
||||
fixtureId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetLapsByFixtureResponse extends ToolResponse {
|
||||
output: {
|
||||
laps: SportmonksMsLap[]
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetLapsByFixtureTool: ToolConfig<
|
||||
SportmonksMsGetLapsByFixtureParams,
|
||||
SportmonksMsGetLapsByFixtureResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_laps_by_fixture',
|
||||
name: 'Get Laps by Fixture',
|
||||
description: 'Retrieve all 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`
|
||||
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')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
laps: Array.isArray(data.data) ? data.data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
laps: {
|
||||
type: 'array',
|
||||
description: 'Array of lap objects for the fixture',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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 SportmonksMsGetLivescoresParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {}
|
||||
|
||||
export interface SportmonksMsGetLivescoresResponse extends ToolResponse {
|
||||
output: {
|
||||
fixtures: SportmonksMsFixture[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetLivescoresTool: ToolConfig<
|
||||
SportmonksMsGetLivescoresParams,
|
||||
SportmonksMsGetLivescoresResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_livescores',
|
||||
name: 'Get Motorsport Livescores',
|
||||
description: 'Retrieve all live 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}/livescores`, 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_livescores')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fixtures: Array.isArray(data.data) ? data.data : [],
|
||||
pagination: data.pagination ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fixtures: {
|
||||
type: 'array',
|
||||
description: 'Array of live motorsport fixture (session) objects',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_FIXTURE_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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 SportmonksMsGetPitstopsByFixtureParams extends SportmonksBaseParams {
|
||||
fixtureId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetPitstopsByFixtureResponse extends ToolResponse {
|
||||
output: {
|
||||
pitstops: SportmonksMsLap[]
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetPitstopsByFixtureTool: ToolConfig<
|
||||
SportmonksMsGetPitstopsByFixtureParams,
|
||||
SportmonksMsGetPitstopsByFixtureResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_pitstops_by_fixture',
|
||||
name: 'Get Pitstops by Fixture',
|
||||
description:
|
||||
'Retrieve all 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`
|
||||
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')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
pitstops: Array.isArray(data.data) ? data.data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
pitstops: {
|
||||
type: 'array',
|
||||
description: 'Array of pitstop objects for the fixture',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_LAP_PROPERTIES },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import {
|
||||
appendSportmonksQuery,
|
||||
buildSportmonksHeaders,
|
||||
handleSportmonksError,
|
||||
type SportmonksBaseParams,
|
||||
} 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 SportmonksMsGetTeamParams extends SportmonksBaseParams {
|
||||
teamId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetTeamResponse extends ToolResponse {
|
||||
output: {
|
||||
team: SportmonksMsTeam | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetTeamTool: ToolConfig<
|
||||
SportmonksMsGetTeamParams,
|
||||
SportmonksMsGetTeamResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_team',
|
||||
name: 'Get Team by ID',
|
||||
description: 'Retrieve a single motorsport team (constructor) by its 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;drivers)',
|
||||
},
|
||||
filters: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filters to apply',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/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')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
team: data.data ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
team: {
|
||||
type: 'object',
|
||||
description: 'The requested team (constructor) object',
|
||||
properties: SPORTMONKS_MS_TEAM_PROPERTIES,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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_STANDING_PROPERTIES,
|
||||
type SportmonksMsStanding,
|
||||
} from '@/tools/sportmonks_motorsport/types'
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface SportmonksMsGetTeamStandingsParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {
|
||||
seasonId: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsGetTeamStandingsResponse extends ToolResponse {
|
||||
output: {
|
||||
standings: SportmonksMsStanding[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetTeamStandingsBySeasonTool: ToolConfig<
|
||||
SportmonksMsGetTeamStandingsParams,
|
||||
SportmonksMsGetTeamStandingsResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_team_standings_by_season',
|
||||
name: 'Get Team Standings by Season',
|
||||
description:
|
||||
'Retrieve the constructors championship standings 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. 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) => {
|
||||
const url = `${SPORTMONKS_MOTORSPORT_BASE_URL}/standings/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_team_standings_by_season')
|
||||
}
|
||||
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 for the season',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_STANDING_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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_TEAM_PROPERTIES,
|
||||
type SportmonksMsTeam,
|
||||
} from '@/tools/sportmonks_motorsport/types'
|
||||
import type { ToolConfig, ToolResponse } from '@/tools/types'
|
||||
|
||||
export interface SportmonksMsGetTeamsParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {}
|
||||
|
||||
export interface SportmonksMsGetTeamsResponse extends ToolResponse {
|
||||
output: {
|
||||
teams: SportmonksMsTeam[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportGetTeamsTool: ToolConfig<
|
||||
SportmonksMsGetTeamsParams,
|
||||
SportmonksMsGetTeamsResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_get_teams',
|
||||
name: 'Get Teams',
|
||||
description: 'Retrieve all motorsport teams (constructors) 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;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) => appendSportmonksQuery(`${SPORTMONKS_MOTORSPORT_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_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',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_TEAM_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +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'
|
||||
@@ -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 SportmonksMsSearchDriversParams
|
||||
extends SportmonksBaseParams,
|
||||
SportmonksPaginationParams {
|
||||
query: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsSearchDriversResponse extends ToolResponse {
|
||||
output: {
|
||||
drivers: SportmonksMsDriver[]
|
||||
pagination?: SportmonksPagination | null
|
||||
}
|
||||
}
|
||||
|
||||
export const sportmonksMotorsportSearchDriversTool: ToolConfig<
|
||||
SportmonksMsSearchDriversParams,
|
||||
SportmonksMsSearchDriversResponse
|
||||
> = {
|
||||
id: 'sportmonks_motorsport_search_drivers',
|
||||
name: 'Search Drivers',
|
||||
description: 'Search for motorsport drivers 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 driver name to search for (e.g. Verstappen)',
|
||||
},
|
||||
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/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_drivers')
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
drivers: Array.isArray(data.data) ? data.data : [],
|
||||
pagination: data.pagination ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
drivers: {
|
||||
type: 'array',
|
||||
description: 'Array of driver objects matching the search query',
|
||||
items: { type: 'object', properties: SPORTMONKS_MS_DRIVER_PROPERTIES },
|
||||
},
|
||||
pagination: SPORTMONKS_PAGINATION_OUTPUT,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,573 @@
|
||||
import type { OutputProperty } from '@/tools/types'
|
||||
|
||||
/**
|
||||
* Base URL for the Sportmonks Motorsport API v3.
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/welcome/welcome
|
||||
*/
|
||||
export const SPORTMONKS_MOTORSPORT_BASE_URL = 'https://api.sportmonks.com/v3/motorsport'
|
||||
|
||||
/**
|
||||
* Output property definitions for a Motorsport Fixture (session) object.
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/fixture
|
||||
*/
|
||||
export const SPORTMONKS_MS_FIXTURE_PROPERTIES = {
|
||||
id: { type: 'number', description: 'Unique id of the fixture (session)' },
|
||||
sport_id: { type: 'number', description: 'Sport of the fixture' },
|
||||
league_id: { type: 'number', description: 'League the fixture is held in' },
|
||||
season_id: { type: 'number', description: 'Season the fixture is held in' },
|
||||
stage_id: { type: 'number', description: 'Stage (race weekend) the fixture is held in' },
|
||||
group_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
aggregate_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
round_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
state_id: { type: 'number', description: 'State the fixture is currently in' },
|
||||
venue_id: { type: 'number', description: 'Venue (track) the fixture is held at', nullable: true },
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Name of the fixture (e.g. Practice 1, Race)',
|
||||
nullable: true,
|
||||
},
|
||||
starting_at: { type: 'string', description: 'Start date and time', nullable: true },
|
||||
result_info: { type: 'string', description: 'Final result info', nullable: true, optional: true },
|
||||
leg: {
|
||||
type: 'string',
|
||||
description: 'Stage of the fixture (e.g. 2/3 for Practice 2)',
|
||||
optional: true,
|
||||
},
|
||||
details: {
|
||||
type: 'string',
|
||||
description: 'Details about the fixture',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
length: {
|
||||
type: 'number',
|
||||
description: 'Session length in minutes or total laps',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
placeholder: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the fixture is a placeholder',
|
||||
optional: true,
|
||||
},
|
||||
has_odds: { type: 'boolean', description: 'Not used in the Motorsport API', optional: true },
|
||||
has_premium_odds: {
|
||||
type: 'boolean',
|
||||
description: 'Not used in the Motorsport API',
|
||||
optional: true,
|
||||
},
|
||||
starting_at_timestamp: {
|
||||
type: 'number',
|
||||
description: 'UNIX timestamp of the start time',
|
||||
optional: true,
|
||||
},
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* Output property definitions for a Driver object.
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/driver
|
||||
*/
|
||||
export const SPORTMONKS_MS_DRIVER_PROPERTIES = {
|
||||
id: { type: 'number', description: 'Unique id of the driver (player_id in responses)' },
|
||||
sport_id: { type: 'number', description: 'Sport of the driver' },
|
||||
country_id: { type: 'number', description: 'Country of birth of the driver', nullable: true },
|
||||
nationality_id: { type: 'number', description: 'Nationality of the driver', nullable: true },
|
||||
city_id: {
|
||||
type: 'number',
|
||||
description: 'City of birth of the driver',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
position_id: {
|
||||
type: 'number',
|
||||
description: 'Position of the driver within the team',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
detailed_position_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
type_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
common_name: { type: 'string', description: 'Name the driver is known for', optional: true },
|
||||
firstname: { type: 'string', description: 'First name of the driver', optional: true },
|
||||
lastname: { type: 'string', description: 'Last name of the driver', optional: true },
|
||||
name: { type: 'string', description: 'Name of the driver' },
|
||||
display_name: { type: 'string', description: 'Display name of the driver', optional: true },
|
||||
image_path: { type: 'string', description: 'URL to the driver headshot', optional: true },
|
||||
height: {
|
||||
type: 'number',
|
||||
description: 'Height of the driver in cm',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
weight: {
|
||||
type: 'number',
|
||||
description: 'Weight of the driver in kg',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
date_of_birth: {
|
||||
type: 'string',
|
||||
description: 'Date of birth of the driver',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
gender: { type: 'string', description: 'Gender of the driver', optional: true },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* Output property definitions for a Motorsport Team (constructor) object.
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/team
|
||||
*/
|
||||
export const SPORTMONKS_MS_TEAM_PROPERTIES = {
|
||||
id: { type: 'number', description: 'Unique id of the team' },
|
||||
sport_id: { type: 'number', description: 'Sport of the team' },
|
||||
country_id: { type: 'number', description: 'Country of the team' },
|
||||
venue_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
gender: { type: 'string', description: 'Gender of the team', optional: true },
|
||||
name: { type: 'string', description: 'Name of the team (constructor)' },
|
||||
short_code: {
|
||||
type: 'string',
|
||||
description: 'Short code of the team',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
image_path: { type: 'string', description: 'URL to the team logo', optional: true },
|
||||
founded: {
|
||||
type: 'number',
|
||||
description: 'Founding year of the team',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
type: { type: 'string', description: 'Type of the team', optional: true },
|
||||
placeholder: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the team is a placeholder',
|
||||
optional: true,
|
||||
},
|
||||
last_played_at: {
|
||||
type: 'string',
|
||||
description: "Date and time of the team's last session",
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* Output property definitions for a Motorsport Standing object.
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/standing
|
||||
*/
|
||||
export const SPORTMONKS_MS_STANDING_PROPERTIES = {
|
||||
id: { type: 'number', description: 'Unique id of the standing' },
|
||||
participant_id: { type: 'number', description: 'Driver or team related to the standing' },
|
||||
sport_id: { type: 'number', description: 'Sport related to the standing' },
|
||||
league_id: { type: 'number', description: 'League related to the standing' },
|
||||
season_id: { type: 'number', description: 'Season related to the standing' },
|
||||
stage_id: { type: 'number', description: 'Stage related to the standing' },
|
||||
group_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
round_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
standing_rule_id: {
|
||||
type: 'number',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
position: { type: 'number', description: 'Position of the participant in the standing' },
|
||||
result: {
|
||||
type: 'string',
|
||||
description: 'Not used in the Motorsport API',
|
||||
nullable: true,
|
||||
optional: true,
|
||||
},
|
||||
points: { type: 'number', description: 'Points the participant has gathered' },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* Output property definitions for a Lap / Pitstop object (identical shape).
|
||||
* @see https://docs.sportmonks.com/v3/motorsport-api/endpoints-and-entities/entities/lap
|
||||
*/
|
||||
export const SPORTMONKS_MS_LAP_PROPERTIES = {
|
||||
id: { type: 'number', description: 'Unique id of the lap/pitstop' },
|
||||
fixture_id: { type: 'number', description: 'Fixture related to the lap/pitstop' },
|
||||
lap_number: { type: 'number', description: 'Lap number in the fixture' },
|
||||
driver_number: { type: 'number', description: 'Number of the driver' },
|
||||
participant_id: { type: 'number', description: 'Driver related to the lap/pitstop' },
|
||||
is_latest: { type: 'boolean', description: 'Whether it is the latest lap/pitstop' },
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
export interface SportmonksMsFixture {
|
||||
id: number
|
||||
sport_id: number
|
||||
league_id: number
|
||||
season_id: number
|
||||
stage_id: number
|
||||
group_id?: number | null
|
||||
aggregate_id?: number | null
|
||||
round_id?: number | null
|
||||
state_id: number
|
||||
venue_id: number | null
|
||||
name: string | null
|
||||
starting_at: string | null
|
||||
result_info?: string | null
|
||||
leg?: string
|
||||
details?: string | null
|
||||
length?: number | null
|
||||
placeholder?: boolean
|
||||
has_odds?: boolean
|
||||
has_premium_odds?: boolean
|
||||
starting_at_timestamp?: number
|
||||
}
|
||||
|
||||
export interface SportmonksMsDriver {
|
||||
id: number
|
||||
sport_id: number
|
||||
country_id: number | null
|
||||
nationality_id: number | null
|
||||
city_id?: number | null
|
||||
position_id?: number | null
|
||||
detailed_position_id?: number | null
|
||||
type_id?: number | null
|
||||
common_name?: string
|
||||
firstname?: string
|
||||
lastname?: string
|
||||
name: string
|
||||
display_name?: string
|
||||
image_path?: string
|
||||
height?: number | null
|
||||
weight?: number | null
|
||||
date_of_birth?: string | null
|
||||
gender?: string
|
||||
}
|
||||
|
||||
export interface SportmonksMsTeam {
|
||||
id: number
|
||||
sport_id: number
|
||||
country_id: number
|
||||
venue_id?: number | null
|
||||
gender?: string
|
||||
name: string
|
||||
short_code?: string | null
|
||||
image_path?: string
|
||||
founded?: number | null
|
||||
type?: string
|
||||
placeholder?: boolean
|
||||
last_played_at?: string | null
|
||||
}
|
||||
|
||||
export interface SportmonksMsStanding {
|
||||
id: number
|
||||
participant_id: number
|
||||
sport_id: number
|
||||
league_id: number
|
||||
season_id: number
|
||||
stage_id: number
|
||||
group_id?: number | null
|
||||
round_id?: number | null
|
||||
standing_rule_id?: number | null
|
||||
position: number
|
||||
result?: string | null
|
||||
points: number
|
||||
}
|
||||
|
||||
export interface SportmonksMsLap {
|
||||
id: number
|
||||
fixture_id: number
|
||||
lap_number: number
|
||||
driver_number: number
|
||||
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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* 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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* 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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* 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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* 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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
* 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<string, OutputProperty>
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user