Skip to main content
Glama
Backspace-me

SportScore

by Backspace-me

get_tracker

Retrieve live tracker data including player positions and animation frames for a football match using its numeric ID.

Instructions

Get live match tracker data (position, animation frames) for a match by numeric id. Usually only useful for football.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sportYesSport to query. One of football, basketball, cricket, tennis.
idYesNumeric match id from the upstream provider.

Implementation Reference

  • src/index.js:166-180 (registration)
    Tool registration: the 'get_tracker' tool is defined in the TOOLS array with its name, description, inputSchema (sport + id), API path (/api/widget/tracker/), and paramMap function that maps args to query params.
    {
      name: "get_tracker",
      description:
        "Get live match tracker data (position, animation frames) for a match by numeric id. Usually only useful for football.",
      inputSchema: {
        type: "object",
        properties: {
          sport: sportSchema,
          id: { type: "string", description: "Numeric match id from the upstream provider." },
        },
        required: ["sport", "id"],
      },
      path: "/api/widget/tracker/",
      paramMap: (args) => ({ sport: args.sport, id: args.id }),
    },
  • Shared sport schema used in get_tracker's inputSchema, validating sport must be one of: football, basketball, cricket, tennis.
    const sportSchema = {
      type: "string",
      enum: SPORTS,
      description: "Sport to query. One of football, basketball, cricket, tennis.",
    };
  • src/index.js:183-183 (registration)
    A Map keyed by tool name that provides O(1) lookup of tool definitions from the TOOLS array. Used in the CallToolRequestSchema handler to find the get_tracker definition at runtime.
    const TOOL_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));
  • Generic tool handler that processes all tools including get_tracker. It looks up the tool by name from TOOL_BY_NAME, validates the sport arg, calls the API via callApi() using the tool's path and paramMap, and returns JSON response with attribution. No custom per-tool logic — all tools share this same handler.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      const { name, arguments: rawArgs } = req.params;
      const tool = TOOL_BY_NAME.get(name);
      if (!tool) {
        return {
          isError: true,
          content: [{ type: "text", text: `Unknown tool: ${name}` }],
        };
      }
      const args = rawArgs ?? {};
      if (args.sport && !SPORTS.includes(args.sport)) {
        return {
          isError: true,
          content: [
            { type: "text", text: `Invalid sport '${args.sport}'. Must be one of: ${SPORTS.join(", ")}.` },
          ],
        };
      }
    
      const params = tool.paramMap(args);
      let result;
      try {
        result = await callApi(tool.path, params);
      } catch (err) {
        return {
          isError: true,
          content: [{ type: "text", text: `Network error calling SportScore API: ${err.message}` }],
        };
      }
    
      const envelope = {
        tool: name,
        request_url: result.url,
        http_status: result.status,
        data: result.body,
        ...attributionFooter(),
      };
    
      return {
        content: [{ type: "text", text: JSON.stringify(envelope, null, 2) }],
        isError: result.status >= 400,
      };
    });
  • Generic API fetch helper used by get_tracker and all other tools. Builds URL from API_BASE + path, appends query params, fetches with JSON headers, returns status/url/body.
    async function callApi(path, params) {
      const url = new URL(API_BASE + path);
      for (const [k, v] of Object.entries(params)) {
        if (v !== undefined && v !== null && v !== "") url.searchParams.set(k, String(v));
      }
      const res = await fetch(url, {
        headers: { "Accept": "application/json", "User-Agent": UA },
      });
      const text = await res.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {
        body = { raw: text, _parse_error: "response was not valid JSON" };
      }
      return { status: res.status, url: url.toString(), body };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description must fully disclose behavioral traits. It mentions retrieving position and animation frames, but omits critical details such as data freshness, whether it works for live or historical matches, rate limits, or permission requirements. This lack of depth leaves the agent with insufficient behavioral context.

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

Conciseness5/5

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

The description is a single sentence that front-loads the main action and purpose. Every word serves a function, with no redundancy or filler. It is concise and immediately informative.

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

Completeness3/5

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

The tool has two required parameters and no output schema. The description covers the basic purpose and data type, but it does not mention response format, error handling, or sport-specific behavior beyond football. For a simple tool, it is minimally acceptable but lacks completeness for an agent to use confidently.

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?

Schema coverage is 100% and both parameters have descriptions. The description adds minimal value by noting 'numeric id' for the id parameter, but it does not enhance understanding beyond what the schema already provides. Baseline score of 3 is appropriate.

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

Purpose5/5

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

The description explicitly states the tool retrieves 'live match tracker data (position, animation frames)' for a match by numeric id, clearly specifying the verb and resource. It also distinguishes itself by noting it's 'usually only useful for football,' contrasting with sibling tools like get_match_detail which likely provide different data.

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

Usage Guidelines3/5

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

The description provides a usage hint by stating 'Usually only useful for football,' implying it may not be suitable for other sports. However, it does not explicitly specify when to use this tool over alternatives like get_match_detail or provide clear exclusions, leaving the agent to infer usage context.

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