Skip to main content
Glama
zafronix

World Cup History MCP

get_player_career

Retrieve a player's complete World Cup history, including team, position, goals, and captain status for each tournament. Use this to compare careers like Pelé or Messi across multiple World Cups.

Instructions

Get a player's full World Cup career: every tournament they appeared in, with team/position/jersey/goals/captain status per year. Use this when the user wants a "all of Pelé's World Cup matches" or "compare Messi's 4 World Cups" view. The name should be the canonical name (use search_players first if unsure).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPlayer name, e.g. "Diego Maradona", "Lionel Messi"

Implementation Reference

  • The handler function for get_player_career: calls the API endpoint `/players/{name}` with the encoded player name. This is the core execution logic that fetches the player's full World Cup career data.
    handler: async (args: { name: string }) =>
      api(`/players/${encodeURIComponent(args.name)}`),
  • Zod schema for get_player_career input validation: requires a `name` string (min 2 chars) describing the player's canonical name.
    schema: z.object({
      name: z.string().min(2).describe('Player name, e.g. "Diego Maradona", "Lionel Messi"'),
    }).strict(),
  • src/index.ts:168-180 (registration)
    Tool registration entry in the `tools` array (lines 113-331). Defines name 'get_player_career', description explaining usage (full career, per-tournament appearance data), and binds schema + handler together.
    {
      name: 'get_player_career',
      description:
        'Get a player\'s full World Cup career: every tournament they appeared in, with ' +
        'team/position/jersey/goals/captain status per year. Use this when the user wants a ' +
        '"all of Pelé\'s World Cup matches" or "compare Messi\'s 4 World Cups" view. The ' +
        'name should be the canonical name (use search_players first if unsure).',
      schema: z.object({
        name: z.string().min(2).describe('Player name, e.g. "Diego Maradona", "Lionel Messi"'),
      }).strict(),
      handler: async (args: { name: string }) =>
        api(`/players/${encodeURIComponent(args.name)}`),
    },
  • The `api()` helper function used by the handler to make authenticated HTTP requests to the Zafronix FIFA World Cup API. Handles auth via X-API-Key header and error reporting.
    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>;
    }
Behavior4/5

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

With no annotations, the description carries the burden. It discloses output fields and input requirement (canonical name). It does not mention that it is read-only or any potential limits, but for a simple retrieval tool, it is sufficiently transparent.

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 concise, with two sentences plus a hint, all front-loaded with the core purpose. Every sentence adds value 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?

For a single-parameter tool without output schema, the description covers input usage and lists output fields. It references a sibling tool for name resolution, providing sufficient context. Minor gap: no mention of whether all data is returned at once or paginated.

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% with a parameter description, so baseline is 3. The description adds value by providing guidance on using canonical names and referencing search_players, going 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 clearly specifies the verb 'Get' and the resource 'player's full World Cup career', listing exact data fields (team, position, jersey, goals, captain status per year). It distinguishes itself from siblings by focusing on career data across tournaments, not individual matches or 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?

Explicit usage examples are given ('all of Pelé's World Cup matches', 'compare Messi's 4 World Cups'), and it advises using search_players first for name canonicalization. This provides clear when-to-use context and an alternative approach.

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