getEntryPicks
Fetch a Fantasy Premier League team's squad selections for a specific gameweek using entry ID and week number.
Instructions
Fetch squad picks of a team for a specific week
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entryId | Yes | ||
| gw | Yes |
Implementation Reference
- src/fpl.ts:65-68 (handler)The core handler function that fetches the Fantasy Premier League API endpoint for a manager's (entry) squad picks in a specific gameweek (gw). This is the primary implementation of the tool logic.export async function getEntryPicks(entryId: number, gw: number): Promise<any> { const res = await fetch(`https://fantasy.premierleague.com/api/entry/${entryId}/event/${gw}/picks/`); return res.json(); }
- src/server.ts:104-104 (schema)Zod-based input schema defining the required parameters: entryId (manager/team ID) as number, gw (gameweek) as number.inputSchema: { entryId: z.number(), gw: z.number() }
- src/server.ts:101-115 (registration)MCP tool registration including title, description, schema, and thin wrapper handler that invokes the core getEntryPicks function and formats the response as MCP content.server.registerTool("getEntryPicks", { title: "Get Entry Picks", description: "Fetch squad picks of a team for a specific week", inputSchema: { entryId: z.number(), gw: z.number() } }, async ({ entryId, gw }) => { const data = await getEntryPicks(entryId, gw); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });