getLeagueStandingsPage
Retrieve a specific page of league standings for Fantasy Premier League competitions with over 50 teams by providing league ID and page number.
Instructions
Fetch a page of league standings for leagues with more than 50 teams
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| leagueId | Yes | ||
| page | Yes |
Implementation Reference
- src/fpl.ts:75-78 (handler)The core handler function implementing the tool logic: fetches the paginated league standings page from the Fantasy Premier League API.export async function getLeagueStandingsPage(leagueId: number, page: number): Promise<any> { const res = await fetch(`https://fantasy.premierleague.com/api/leagues-classic/${leagueId}/standings/?page_standings=${page}`); return res.json(); }
- src/server.ts:135-149 (registration)MCP tool registration for 'getLeagueStandingsPage', including title, description, Zod input schema, and thin wrapper handler that invokes the core function and returns formatted response.server.registerTool("getLeagueStandingsPage", { title: "Get League Standings Page", description: "Fetch a page of league standings for leagues with more than 50 teams", inputSchema: { leagueId: z.number(), page: z.number() } }, async ({ leagueId, page }) => { const data = await getLeagueStandingsPage(leagueId, page); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });
- src/server.ts:138-138 (schema)Zod schema defining input parameters: leagueId (number) and page (number).inputSchema: { leagueId: z.number(), page: z.number() }