fixtures.list
Retrieve upcoming Serie A football matches within a specified number of days, including team details, kickoff times, and venue information for betting analysis.
Instructions
Ritorna i prossimi match di Serie A entro X giorni (id, squadre, kickoff, venue).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Numero di giorni in avanti da scandire |
Implementation Reference
- src/tools/fixtures.ts:12-22 (handler)The main handler function for the 'fixtures.list' tool. It calls the apiFootball client to get upcoming fixtures and returns a formatted JSON response.execute: async (args) => { const fixtures = await apiFootball.getUpcomingFixtures(args.days ?? 3); return JSON.stringify( { window_days: args.days ?? 3, fixtures, }, null, 2, ); },
- src/clients/apiFootball.ts:74-89 (helper)Helper method in ApiFootballClient that fetches upcoming Serie A fixtures within the specified number of days using the API, maps the response, and returns FixtureSummary array.public async getUpcomingFixtures(days: number): Promise<FixtureSummary[]> { const now = new Date(); const from = toIsoDate(now); const to = new Date(now); to.setDate(now.getDate() + days); const params = { league: config.apiFootball.leagueId, season: config.apiFootball.season, from: from, to: toIsoDate(to), }; const data = await this.get<FixtureResponse>("/fixtures", params); return data.response.map(mapFixtureSummary); }
- src/tools/fixtures.ts:7-11 (schema)Tool schema including name, description, and Zod input parameter schema for 'days'.name: "fixtures.list", description: "Ritorna i prossimi match di Serie A entro X giorni (id, squadre, kickoff, venue).", parameters: z.object({ days: z.number().int().min(1).max(10).default(3).describe("Numero di giorni in avanti da scandire"), }),
- src/tools/fixtures.ts:6-23 (registration)The server.addTool call that registers the 'fixtures.list' tool within the registerFixturesTool function.server.addTool({ name: "fixtures.list", description: "Ritorna i prossimi match di Serie A entro X giorni (id, squadre, kickoff, venue).", parameters: z.object({ days: z.number().int().min(1).max(10).default(3).describe("Numero di giorni in avanti da scandire"), }), execute: async (args) => { const fixtures = await apiFootball.getUpcomingFixtures(args.days ?? 3); return JSON.stringify( { window_days: args.days ?? 3, fixtures, }, null, 2, ); }, });
- src/index.ts:16-16 (registration)Invocation of registerFixturesTool on the MCP server instance, effectively registering the tool.registerFixturesTool(server);