Skip to main content
Glama
Backspace-me

SportScore

by Backspace-me

get_team_schedule

Retrieve past and upcoming fixtures for any team by providing its slug and sport. Choose from football, basketball, cricket, or tennis.

Instructions

Get a team's past and upcoming fixtures by team slug (e.g. 'barcelona', 'manchester-united', 'los-angeles-lakers').

Input Schema

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

Implementation Reference

  • Tool definition with inputSchema (type, properties: sport, slug, limit) and paramMap for the 'get_team_schedule' tool. Maps to endpoint /api/widget/team/.
    {
      name: "get_team_schedule",
      description:
        "Get a team's past and upcoming fixtures by team slug (e.g. 'barcelona', 'manchester-united', 'los-angeles-lakers').",
      inputSchema: {
        type: "object",
        properties: {
          sport: sportSchema,
          slug: { type: "string", description: "Team slug." },
          limit: { type: "integer", minimum: 1, maximum: 30, default: 10 },
        },
        required: ["sport", "slug"],
      },
      path: "/api/widget/team/",
      paramMap: (args) => ({ sport: args.sport, slug: args.slug, limit: args.limit ?? 10 }),
  • src/index.js:183-183 (registration)
    Tool lookup map (TOOL_BY_NAME) built from the TOOLS array, enabling dispatch by tool name including 'get_team_schedule'.
    const TOOL_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));
  • The generic CallToolRequestSchema handler that dispatches all tools. When 'get_team_schedule' is called, it looks up the tool definition from TOOL_BY_NAME, calls tool.paramMap(args) to build query params, then calls callApi('/api/widget/team/', params) to fetch data from the SportScore API.
    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 HTTP fetch utility (callApi) used by all tools. For 'get_team_schedule', it calls API_BASE + '/api/widget/team/' with the params from paramMap.
    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 };
    }
  • src/index.js:224-226 (registration)
    ListToolsRequestSchema handler — exposes all tools (including 'get_team_schedule') to the MCP host by returning name, description, and inputSchema for each.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
    }));

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.1/5.0
Behavior3/5

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

Description discloses that the tool returns both past and upcoming fixtures (read-only), adding behavioral context beyond parameter names. With no annotations, this is beneficial but limited—no mention of ordering, pagination, or what constitutes a fixture. Does not contradict any annotations.

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 with 16 words includes purpose, resource, input method, and examples. No unnecessary words or repetition. Excellent front-loading.

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?

For a tool with 3 parameters and no output schema, description adequately explains input but omits return structure (what fields in a fixture) and the effect of the limit parameter. Without an output schema, this gap reduces completeness for an agent to correctly interpret results.

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 67% (slug and sport described; limit has only constraints). Description adds value for the slug parameter with real-world examples (e.g., 'manchester-united'), clarifying the hyphenated lowercase format not evident from the schema. No extra information for limit or sport beyond schema defaults.

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?

Description clearly states 'Get a team's past and upcoming fixtures' and uses specific verb 'Get' with resource 'team schedule' identified by 'team slug'. Examples like 'barcelona' and 'manchester-united' clarify expected input format. This distinctly separates it from sibling tools like get_matches or get_match_detail.

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?

Description provides clear context: use when you need a team's list of fixtures by slug, with concrete examples. However, it does not explicitly state when to use this tool over alternatives (e.g., get_matches or get_match_detail), leaving differentiation implicit.

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