getEntryHistory
Retrieve current and past season performance data for a Fantasy Premier League team by entering its entry ID to analyze historical results.
Instructions
Fetch this and previous season performance of a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entryId | Yes |
Implementation Reference
- src/fpl.ts:55-58 (handler)Core handler function that performs the API fetch for entry history data from Fantasy Premier League.export async function getEntryHistory(entryId: number): Promise<any> { const res = await fetch(`https://fantasy.premierleague.com/api/entry/${entryId}/history/`); return res.json(); }
- src/server.ts:67-81 (registration)Registers the MCP tool 'getEntryHistory' with title, description, input schema (entryId: number), and a wrapper handler that calls the core function and formats the JSON response.server.registerTool("getEntryHistory", { title: "Get Entry History", description: "Fetch this and previous season performance of a team", inputSchema: { entryId: z.number() } }, async ({ entryId }) => { const data = await getEntryHistory(entryId); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });