Skip to main content
Glama

getGameweekData

Fetch comprehensive gameweek data from Fantasy Premier League, including fixtures, player statistics, and league standings for analysis and decision-making.

Instructions

Fetch all gameweek data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that fetches the FPL bootstrap-static API and returns the events (gameweek data) as Partial<FplApiObject>.
    export async function getGameweekData(): Promise<Partial<FplApiObject>> { const data = await getBootstrapStatic(); return { events: data.events, }; }
  • src/server.ts:217-231 (registration)
    Registers the "getGameweekData" MCP tool, specifying title, description, empty input schema (no parameters), and an inline handler that invokes getGameweekData() and formats the response as MCP content.
    server.registerTool("getGameweekData", { title: "Get Gameweek Data", description: "Fetch all gameweek data", inputSchema: {} }, async () => { const data = await getGameweekData(); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; });
  • TypeScript interface defining the structure of FplApiObject, used in the return type of getGameweekData (Partial<FplApiObject> with events).
    export interface FplApiObject { chips: Partial<Chip>[]; events: Partial<Event>[]; element_types: Partial<ElementType>[]; teams: Partial<Team>[]; elements: Partial<Element>[]; }
  • Helper function that fetches the full FPL bootstrap-static data, called by getGameweekData to retrieve the events.
    export async function getBootstrapStatic(): Promise<FplApiObject> { const res = await fetch('https://fantasy.premierleague.com/api/bootstrap-static/'); return res.json() as Promise<FplApiObject>; }

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