getEntry
Fetch Fantasy Premier League team information by entering a specific entry ID to retrieve general team details and statistics.
Instructions
Fetch general info about a team by entry ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entryId | Yes |
Implementation Reference
- src/fpl.ts:135-138 (handler)The core handler function that fetches the team entry data from the Fantasy Premier League API endpoint `/api/entry/{entryId}/` and returns the JSON response.export async function getEntry(entryId: number): Promise<any> { const res = await fetch(`https://fantasy.premierleague.com/api/entry/${entryId}/`); return res.json(); }
- src/server.ts:284-298 (registration)Registers the 'getEntry' MCP tool, defining its input schema (entryId: number), metadata, and a thin wrapper handler that invokes the core getEntry function and formats the response as MCP content.server.registerTool("getEntry", { title: "Get Entry", description: "Fetch general info about a team by entry ID", inputSchema: { entryId: z.number() } }, async ({ entryId }) => { const data = await getEntry(entryId); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });
- src/server.ts:287-287 (schema)Input schema validation using Zod: requires an entryId as a number.inputSchema: { entryId: z.number() }