Skip to main content
Glama
Backspace-me

SportScore

by Backspace-me

get_top_scorers

Retrieve top scorers or assist leaders for any competition in football, basketball, cricket, or tennis. Provide sport and competition slug to view ranked player stats.

Instructions

Get the top scorers (or top assisters) for a competition. Useful for 'who's leading the Premier League scoring charts?'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sportYesSport to query. One of football, basketball, cricket, tennis.
slugYesCompetition slug.
limitNo
statNogoals

Implementation Reference

  • src/index.js:114-135 (registration)
    The 'get_top_scorers' tool is registered as the 5th entry in the TOOLS array (lines 114-135). It defines the tool name, description, input schema (sport, slug, limit, stat), API path (/api/widget/topscorers/), and a paramMap that converts user args to API query parameters.
    {
      name: "get_top_scorers",
      description:
        "Get the top scorers (or top assisters) for a competition. Useful for 'who's leading the Premier League scoring charts?'.",
      inputSchema: {
        type: "object",
        properties: {
          sport: sportSchema,
          slug: { type: "string", description: "Competition slug." },
          limit: { type: "integer", minimum: 1, maximum: 50, default: 20 },
          stat: { type: "string", enum: ["goals", "assists"], default: "goals" },
        },
        required: ["sport", "slug"],
      },
      path: "/api/widget/topscorers/",
      paramMap: (args) => ({
        sport: args.sport,
        slug: args.slug,
        limit: args.limit ?? 20,
        stat: args.stat ?? "goals",
      }),
    },
  • The input schema for get_top_scorers requires 'sport' (string enum: football/basketball/cricket/tennis) and 'slug' (competition slug string), with optional 'limit' (integer 1-50, default 20) and 'stat' (enum 'goals'/'assists', default 'goals').
    inputSchema: {
      type: "object",
      properties: {
        sport: sportSchema,
        slug: { type: "string", description: "Competition slug." },
        limit: { type: "integer", minimum: 1, maximum: 50, default: 20 },
        stat: { type: "string", enum: ["goals", "assists"], default: "goals" },
      },
      required: ["sport", "slug"],
    },
  • The handler is a generic CallToolRequestSchema handler (lines 228-270) that looks up the tool by name in TOOL_BY_NAME, calls paramMap(args) to build query params, invokes callApi() with the tool's path/params, and returns the JSON response wrapped with attribution.
    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,
      };
    });
  • src/index.js:183-183 (registration)
    The TOOL_BY_NAME Map is built from the TOOLS array and is used by the handler to look up tool configs by name at runtime.
    const TOOL_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));

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?

No annotations are provided. The description does not disclose behavioral traits such as read-only nature, rate limits, pagination behavior, or data freshness. For a tool with no annotations, this is insufficient.

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?

Two concise sentences. Front-loaded with purpose, followed by a relevant example. No wasted words.

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?

Adequate for a simple list tool, but no output schema or description of return format. Missing details on competition specification and scoring definition.

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 50%; the description adds context for the stat parameter by mentioning 'top assisters', but does not explain the limit or sport parameter beyond what schema already provides. Partially compensates.

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 clearly states the tool retrieves top scorers or assisters for a competition, with a concrete example. It effectively distinguishes from sibling tools like get_matches or get_player.

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?

Provides a typical use case example but no explicit guidance on when to use vs alternatives or when not to use. Lacks exclusion criteria.

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