getFixturesForGameweek
Fetch fixtures for a specific Fantasy Premier League gameweek to view match schedules and plan team selections.
Instructions
Fetch fixtures for a specific gameweek
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gw | Yes |
Implementation Reference
- src/fpl.ts:1-4 (handler)The core handler function that fetches and returns fixtures data for a specific gameweek (gw) from the Fantasy Premier League API.export async function getFixturesForGameweek(gw: number): Promise<any> { const res = await fetch(`https://fantasy.premierleague.com/api/fixtures/?event=${gw}`); return res.json(); }
- src/server.ts:33-47 (registration)MCP tool registration for 'getFixturesForGameweek', including title, description, input schema (gw: number), and wrapper handler that calls the core function and formats response.server.registerTool("getFixturesForGameweek", { title: "Get Fixtures For Gameweek", description: "Fetch fixtures for a specific gameweek", inputSchema: { gw: z.number() } }, async ({ gw }) => { const data = await getFixturesForGameweek(gw); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });
- src/server.ts:36-36 (schema)Input schema definition using Zod for the gameweek parameter (gw: number).inputSchema: { gw: z.number() }