Skip to main content
Glama
Backspace-me

SportScore

by Backspace-me

get_player

Retrieve player statistics and metadata by providing a sport and player slug.

Instructions

Get player statistics and metadata by player slug (e.g. 'lionel-messi', 'lebron-james', 'virat-kohli').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sportYesSport to query. One of football, basketball, cricket, tennis.
slugYesPlayer slug.

Implementation Reference

  • Tool definition for 'get_player' including its input schema, API path, and parameter mapping function.
    {
      name: "get_player",
      description:
        "Get player statistics and metadata by player slug (e.g. 'lionel-messi', 'lebron-james', 'virat-kohli').",
      inputSchema: {
        type: "object",
        properties: {
          sport: sportSchema,
          slug: { type: "string", description: "Player slug." },
        },
        required: ["sport", "slug"],
      },
      path: "/api/widget/player/",
      paramMap: (args) => ({ sport: args.sport, slug: args.slug }),
    },
  • src/index.js:183-183 (registration)
    Registration of all tools (including get_player) into a Map for lookup by name.
    const TOOL_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));
  • General CallTool handler that dispatches all tool calls (including get_player) by looking up the tool's path and paramMap from TOOL_BY_NAME, calling the API via callApi(), and returning the JSON response.
    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,
      };
    });

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4/5.0
Behavior3/5

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

No annotations provided, so the description must disclose behavioral traits. It states it retrieves statistics and metadata, which is a safe read operation. However, it does not mention authentication requirements, rate limits, or the scope of data returned. Basic but sufficient for a simple retrieval tool.

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?

Single sentence front-loads the action and resource. No wasted words. The example slugs are efficient and enhance clarity without redundancy.

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

Completeness4/5

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

Given the tool's simplicity (2 parameters, no output schema, no nested objects), the description is nearly complete. It covers the core purpose and parameter usage. Minor gap: it does not specify whether the response is a single player or a list, but the singular 'player' implies one. No return format details are necessary if the schema is self-documenting.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by providing concrete examples of slugs (lionel-messi, etc.), which clarifies the expected format beyond the schema's 'Player slug.' description. This helps an agent understand the required pattern.

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?

Clear verb 'Get' paired with resource 'player statistics and metadata'. Provides specific slug examples (lionel-messi, lebron-james, virat-kohli) that distinguish it from sibling tools like get_bracket or get_match_detail which operate on different entities.

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?

Description implies the tool is used when you have a player slug and sport, but does not explicitly state when to prefer this tool over alternatives. No exclusion criteria or context for when not to use it. Usage is inferred but not guided.

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