Skip to main content
Glama
zafronix

World Cup History MCP

get_match

Retrieve a World Cup match's full details—kickoff, teams, score, extra time, penalties, stadium, and more—by providing its ID like '1986-052'.

Instructions

Single match by ID. IDs follow {year}-{ordinal} zero-padded — the 1986 final is "1986-052", the 2022 final is "2022-064", the 2026 opener is "2026-001". Returns kickoff, both teams, score, extra time, penalties, stadium, city, attendance, referee, and (with denormalize=true) the full stadium block.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMatch ID, e.g. "1986-052"
denormalizeNo

Implementation Reference

  • src/index.ts:273-288 (registration)
    Tool registration for 'get_match' in the tools array, including its name, description, schema, and handler.
    {
      name: 'get_match',
      description:
        'Single match by ID. IDs follow {year}-{ordinal} zero-padded — the 1986 final is ' +
        '"1986-052", the 2022 final is "2022-064", the 2026 opener is "2026-001". Returns ' +
        'kickoff, both teams, score, extra time, penalties, stadium, city, attendance, referee, ' +
        'and (with denormalize=true) the full stadium block.',
      schema: z.object({
        id: z.string().regex(/^\d{4}-\d{3}$/).describe('Match ID, e.g. "1986-052"'),
        denormalize: z.boolean().optional().describe('Embed full stadium details (default false)'),
      }).strict(),
      handler: async (args: { id: string; denormalize?: boolean }) => {
        const q = args.denormalize ? '?denormalize=true' : '';
        return api(`/matches/${args.id}${q}`);
      },
    },
  • Zod schema for get_match: requires 'id' (string matching pattern ^\d{4}-\d{3}$) and optional boolean 'denormalize'.
    schema: z.object({
      id: z.string().regex(/^\d{4}-\d{3}$/).describe('Match ID, e.g. "1986-052"'),
      denormalize: z.boolean().optional().describe('Embed full stadium details (default false)'),
    }).strict(),
  • Handler function for get_match: constructs a query string with optional denormalize parameter and calls the API at /matches/{id}.
    handler: async (args: { id: string; denormalize?: boolean }) => {
      const q = args.denormalize ? '?denormalize=true' : '';
      return api(`/matches/${args.id}${q}`);
    },
  • The api() helper function used by the get_match handler to make authenticated HTTP requests to the Zafronix WC API.
    async function api<T = unknown>(path: string): Promise<T> {
      if (!API_KEY) {
        throw new Error(
          'WC_API_KEY is not set in the environment. Get a free key at ' +
          'https://api.zafronix.com/signup and add it to your MCP client ' +
          'config: { "env": { "WC_API_KEY": "zwc_pk_..." } }',
        );
      }
      const url = path.startsWith('http') ? path : `${API_BASE}${path}`;
      const res = await fetch(url, {
        headers: {
          'X-API-Key':  API_KEY,
          'Accept':     'application/json',
          'User-Agent': 'wc-mcp/0.1.2',
        },
      });
      if (!res.ok) {
        const body = await res.text().catch(() => '');
        throw new Error(`API ${res.status} ${res.statusText} on ${path}: ${body.slice(0, 240)}`);
      }
      return res.json() as Promise<T>;
    }
    
    // Helper that returns MCP-shaped content. We always emit plain text with
    // JSON inside; the model handles structured reasoning fine and this keeps
    // the tool surface stable across MCP SDK minor versions.
    function jsonContent(payload: unknown) {
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }],
      };
    }
  • The CallToolRequestSchema handler that routes tool invocations (including get_match) to their respective handlers.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      const tool = tools.find((t) => t.name === name);
      if (!tool) return errorContent(`unknown tool: ${name}`);
      try {
        const parsed = tool.schema.parse(args ?? {});
        // The handler signatures vary per tool; cast to any here is local +
        // narrow. Each handler is type-checked against its own schema.
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        const result = await (tool.handler as any)(parsed);
        return jsonContent(result);
      } catch (err) {
        if (err instanceof z.ZodError) {
          return errorContent(`invalid arguments: ${err.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join('; ')}`);
        }
        return errorContent(err instanceof Error ? err.message : String(err));
      }
    });
Behavior4/5

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

Discloses returned fields (kickoff, teams, score, etc.) and the effect of 'denormalize=true'. No annotations exist, so description carries burden. Could mention need for valid ID or error handling.

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

Conciseness4/5

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

Efficient single sentence with examples and list of fields. Front-loaded with purpose. Could be slightly more structured (e.g., bullet points) but not verbose.

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?

For a simple ID lookup with one optional parameter and no output schema, the description covers purpose, ID format, return fields, and parameter effect comprehensively.

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

Parameters5/5

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

Adds significant meaning: explains ID format with concrete examples and clarifies that 'denormalize=true' returns the full stadium block. Schema coverage is only 50%, but description fully 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?

Explicitly states 'Single match by ID', identifies the resource and action. Distinguishes from sibling 'list_matches' which lists multiple matches.

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?

Provides ID format examples and indicates when to use – when you have a specific match ID. Implicitly distinguishes from list_matches but does not explicitly state when not to use or mention alternatives.

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/zafronix/wc-mcp'

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