Skip to main content
Glama
Backspace-me

SportScore

get_matches

Retrieve live and recent matches for football, basketball, cricket, or tennis. View scores, status, kickoff times, and team logos.

Instructions

List live and recent matches for a sport. Returns up to limit matches with scores, status, kickoff time and team logos. Good default for 'what's happening in football right now?'.

Input Schema

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

Implementation Reference

  • src/index.js:53-67 (registration)
    Tool registration in TOOLS array. Defines name 'get_matches', description, inputSchema (sport + limit), API path '/api/widget/matches/', and paramMap to build query params.
    {
      name: "get_matches",
      description:
        "List live and recent matches for a sport. Returns up to `limit` matches with scores, status, kickoff time and team logos. Good default for 'what's happening in football right now?'.",
      inputSchema: {
        type: "object",
        properties: {
          sport: sportSchema,
          limit: { type: "integer", minimum: 1, maximum: 50, default: 10 },
        },
        required: ["sport"],
      },
      path: "/api/widget/matches/",
      paramMap: (args) => ({ sport: args.sport, limit: args.limit ?? 10 }),
    },
  • Generic CallToolRequestSchema handler that executes ALL tools including 'get_matches'. Looks up the tool by name from TOOL_BY_NAME, calls paramMap to build params, invokes callApi(tool.path, params), and wraps the result in a JSON envelope 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,
      };
    });
  • callApi function — the generic HTTP fetch helper used by the handler to call the SportScore API at the tool's path with the tool's params.
    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 };
    }
  • sportSchema — shared enum validator reused by get_matches and other tools. Allows 'football', 'basketball', 'cricket', 'tennis'.
    const sportSchema = {
      type: "string",
      enum: SPORTS,
      description: "Sport to query. One of football, basketball, cricket, tennis.",
    };
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns up to `limit` matches with specific fields, implies read-only behavior (listing), and provides scope ('live and recent'). No contradictions or hidden behavioral traits are present.

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 two sentences: the first specifies action and output, the second gives usage context. Every word is purposeful; no redundancy or unnecessary detail.

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

Completeness5/5

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

Given 2 parameters, no output schema, and no annotations, the description covers all essential aspects: what it does, what it returns, parameter guidance, and typical use case. It is self-sufficient for an agent to invoke correctly.

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 50% (sport described, limit not). The description compensates by explicitly tying 'limit' to the number of matches returned, and 'sport' is contextualized via 'for a sport'. Together, they add meaning beyond the schema alone.

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 uses a specific verb ('List') and resource ('live and recent matches'), clearly distinguishing it from siblings like get_match_detail (specific match) and get_standings (standings). It enumerates returned data fields (scores, status, kickoff time, team logos), leaving no ambiguity.

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

Usage Guidelines4/5

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

The description explicitly states 'Good default for "what's happening in football right now?"' which provides clear usage context. While it does not explicitly mention when not to use it or list alternatives, the context effectively guides the agent to use this tool as a starting point.

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/Backspace-me/sportscore-mcp'

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