Skip to main content
Glama

getPlayerData

Fetch comprehensive Fantasy Premier League player statistics and performance data to analyze team selections and track player form.

Instructions

Fetch all player data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.ts:185-199 (registration)
    Registration of the MCP tool 'getPlayerData' including inline input schema (empty object) and the thin handler wrapper that calls the helper function and formats response as JSON text content.
    server.registerTool("getPlayerData", { title: "Get Player Data", description: "Fetch all player data", inputSchema: {} }, async () => { const data = await getPlayerData(); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });
  • Core handler logic for fetching player data (elements) from FPL bootstrap-static API, returning a partial FplApiObject.
    export async function getPlayerData(): Promise<Partial<FplApiObject>> { const data = await getBootstrapStatic(); return { elements: data.elements, }; }
  • Helper function called by getPlayerData to fetch the full bootstrap-static data from FPL API.
    export async function getBootstrapStatic(): Promise<FplApiObject> { const res = await fetch('https://fantasy.premierleague.com/api/bootstrap-static/'); return res.json() as Promise<FplApiObject>; }
  • TypeScript interface defining the structure of FPL API response object, used in getPlayerData return type.
    export interface FplApiObject { chips: Partial<Chip>[]; events: Partial<Event>[]; element_types: Partial<ElementType>[]; teams: Partial<Team>[]; elements: Partial<Element>[]; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/owen-lacey/fpl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server