Skip to main content
Glama
owen-lacey

FPL MCP Server

by owen-lacey

getLeagueStandings

Retrieve Fantasy Premier League standings by league ID to view team rankings and performance data.

Instructions

Fetch information about a league by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leagueIdYes

Implementation Reference

  • MCP tool handler function for getLeagueStandings that calls the helper function and returns the data as JSON text content.
    }, async ({ leagueId }) => {
      const data = await getLeagueStandings(leagueId);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    });
  • Zod input schema defining leagueId as a required number.
    inputSchema: { leagueId: z.number() }
  • src/server.ts:118-132 (registration)
    Registration of the getLeagueStandings tool with the MCP server, including metadata, schema, and handler.
    server.registerTool("getLeagueStandings", {
      title: "Get League Standings",
      description: "Fetch information about a league by ID",
      inputSchema: { leagueId: z.number() }
    }, async ({ leagueId }) => {
      const data = await getLeagueStandings(leagueId);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    });
  • Core helper function that performs the HTTP fetch to the FPL API for league standings.
    export async function getLeagueStandings(leagueId: number): Promise<any> {
      const res = await fetch(`https://fantasy.premierleague.com/api/leagues-classic/${leagueId}/standings/`);
      return res.json();
    }

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