Skip to main content
Glama
zafronix

World Cup History MCP

get_tournament

Retrieve full details for any FIFA World Cup tournament by year, including teams, groups, knockout brackets, awards, squads, attendance, and trivia notes.

Instructions

Get full details for a single World Cup tournament: every team that played, group stages, knockout brackets, awards (top scorer, best player, best young player, best GK), full squads with DOB/position/club, attendance, and trivia notes. Use this when the user asks about a specific year ("1986 World Cup", "what happened at Italia 90"). For comparisons across multiple tournaments use compare_tournaments instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesTournament year, e.g. 1986

Implementation Reference

  • src/index.ts:113-135 (registration)
    The 'get_tournament' tool is registered within the tools array (lines 124-135). Its schema accepts a 'year' parameter, and its handler calls the api() helper with /tournaments/{year}.
    const tools = [
      {
        name: 'list_tournaments',
        description:
          'List every FIFA World Cup tournament (1930 → 2026) with year, host country list, ' +
          'champion (or null for the upcoming 2026 cup). Useful as a starting point when the ' +
          'user is exploring history or needs to disambiguate a year.',
        schema: z.object({}).strict(),
        handler: async () => api('/tournaments'),
      },
      {
        name: 'get_tournament',
        description:
          'Get full details for a single World Cup tournament: every team that played, group ' +
          'stages, knockout brackets, awards (top scorer, best player, best young player, best ' +
          'GK), full squads with DOB/position/club, attendance, and trivia notes. Use this when ' +
          'the user asks about a specific year ("1986 World Cup", "what happened at Italia 90"). ' +
          'For comparisons across multiple tournaments use compare_tournaments instead.',
        schema: z.object({
          year: z.number().int().min(1930).max(2030).describe('Tournament year, e.g. 1986'),
        }).strict(),
        handler: async (args: { year: number }) => api(`/tournaments/${args.year}`),
      },
  • The handler function for get_tournament — an async function that takes { year: number } and calls the API helper to fetch /tournaments/{year}.
      handler: async (args: { year: number }) => api(`/tournaments/${args.year}`),
    },
  • Zod schema for get_tournament: expects a single 'year' integer parameter between 1930 and 2030.
    schema: z.object({
      year: z.number().int().min(1930).max(2030).describe('Tournament year, e.g. 1986'),
    }).strict(),
  • The generic api() helper function used by get_tournament's handler. It constructs the URL, adds auth headers, fetches the endpoint, and returns parsed JSON.
    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>;
    }
  • src/index.ts:397-403 (registration)
    The MCP ListTools handler that exposes get_tournament to clients via the tools/list protocol.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools.map((t) => ({
        name:        t.name,
        description: t.description,
        inputSchema: zodToJsonSchema(t.schema),
      })),
    }));
Behavior4/5

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

No annotations provided, so description carries full burden. It describes the output as a comprehensive set of details (teams, groups, brackets, awards, squads, attendance, trivia), implying a read operation with no side effects. Does not explicitly state read-only but is clear about returns.

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?

Two sentences: first sentence lists contents, second gives usage guidance. Front-loaded with key information. Could be slightly tighter, but no wasted words.

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 no output schema and one simple parameter, the description adequately explains what the tool returns and when to use it. It covers the scope of the data (full details) without needing to specify output format.

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?

Only one parameter 'year' with schema description 'Tournament year, e.g. 1986'. Schema coverage is 100%, so description adds minimal value beyond schema. Usage guidance in description reinforces the parameter's purpose but does not add new semantics.

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?

Clearly states it retrieves full details for a single World Cup tournament, including specific elements like teams, groups, brackets, awards, squads, attendance, and trivia. Distinguishes from sibling by specifying 'single' and contrasting with compare_tournaments.

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

Usage Guidelines5/5

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

Explicitly states when to use: when user asks about a specific year ('1986 World Cup', 'what happened at Italia 90'). Also provides when not to use and alternative: 'For comparisons across multiple tournaments use compare_tournaments instead.'

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