Skip to main content
Glama

match.snapshot

Retrieve match statistics including form, rankings, goals scored/conceded, and recent results for football betting analysis.

Instructions

Restituisce forma, classifica, gol fatti/subiti e ultimi risultati per il match richiesto.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
match_idYesmatch_id fornito da API-Football

Implementation Reference

  • Core handler function that fetches and assembles the match snapshot data including fixture, standings, team stats, and recent results for both teams.
    export const buildMatchSnapshot = async (matchId: number): Promise<MatchSnapshot> => {
      const fixture = await apiFootball.getFixture(matchId);
      if (!fixture) {
        throw new Error(`Fixture ${matchId} not found on API-Football`);
      }
    
      const standings = await apiFootball.getStandingsMap();
      const [homeStats, awayStats] = await Promise.all([
        apiFootball.getTeamStatistics(fixture.homeTeam.id),
        apiFootball.getTeamStatistics(fixture.awayTeam.id),
      ]);
    
      const [homeResults, awayResults] = await Promise.all([
        apiFootball.getRecentMatches(fixture.homeTeam.id),
        apiFootball.getRecentMatches(fixture.awayTeam.id),
      ]);
    
      const homeSnapshot = enrichTeamSnapshot(fixture.homeTeam.id, standings, homeStats, homeResults);
      const awaySnapshot = enrichTeamSnapshot(fixture.awayTeam.id, standings, awayStats, awayResults);
    
      return {
        match: fixture,
        home: {
          ...homeSnapshot,
          team: fixture.homeTeam,
        },
        away: {
          ...awaySnapshot,
          team: fixture.awayTeam,
        },
      };
    };
  • Registers the 'match.snapshot' tool with FastMCP, including schema, description, and execute handler that delegates to buildMatchSnapshot.
    export const registerMatchSnapshotTool = (server: FastMCP) => {
      server.addTool({
        name: "match.snapshot",
        description: "Restituisce forma, classifica, gol fatti/subiti e ultimi risultati per il match richiesto.",
        parameters: z.object({
          match_id: z.number().int().describe("match_id fornito da API-Football"),
        }),
        execute: async (args) => {
          const snapshot = await buildMatchSnapshot(args.match_id);
          return JSON.stringify(snapshot, null, 2);
        },
      });
    };
  • Zod schema defining the input parameter 'match_id' as integer.
    parameters: z.object({
      match_id: z.number().int().describe("match_id fornito da API-Football"),
    }),
  • Helper function to enrich team snapshot with league position, points, form, average goals, and recent results.
    const enrichTeamSnapshot = (
      teamId: number,
      standings: Map<number, { position: number; points: number; form?: string }>,
      stats: { avgGoalsFor: number; avgGoalsAgainst: number } | undefined,
      recentResults: TeamSnapshot["recentResults"],
    ): Omit<TeamSnapshot, "team"> => {
      const standing = standings.get(teamId);
      return {
        leaguePosition: standing?.position,
        points: standing?.points,
        form: standing?.form,
        avgGoalsFor: stats?.avgGoalsFor,
        avgGoalsAgainst: stats?.avgGoalsAgainst,
        recentResults,
      };
    };
  • src/index.ts:17-17 (registration)
    Top-level call to register the match.snapshot tool in the main server setup.
    registerMatchSnapshotTool(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns data but doesn't specify if it's a read-only operation, whether it requires authentication, rate limits, error handling, or the format of returned data (e.g., JSON structure). For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand quickly. However, it could be slightly improved by structuring key points (e.g., bullet points) for clarity, but this is minor.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a data retrieval tool with no annotations and no output schema), the description is incomplete. It doesn't explain the return values in detail (e.g., what 'forma' or 'classifica' mean), error cases, or how to interpret results. With no output schema and minimal behavioral context, the description fails to provide enough information for an agent to use the tool effectively beyond basic invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with 'match_id' documented as an integer from API-Football. The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract from the schema's information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns specific match data (shape, classification, goals scored/conceded, and recent results) for a requested match. It uses specific verbs ('Restituisce' - returns) and resources ('match richiesto' - requested match), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'fixtures.list' or 'odds.prematch', which might also provide match-related information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a valid match_id from API-Football, or compare its functionality to sibling tools like 'fixtures.list' (which might list matches) or 'odds.prematch' (which might provide odds). Usage is implied only by the tool's name and description, with no explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Valerio357/bet_mcp'

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