get_team
Retrieve a national team's complete World Cup history, including tournament appearances, final positions, total titles, and knockout records for cross-tournament analysis.
Instructions
Cross-tournament summary for a national team: every appearance, final position by year, total titles, knockout records. Use this for "Brazil's World Cup history" or "how many times has Argentina reached the final?". For a specific year's squad use get_team_roster.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Country name, e.g. "Brazil", "West Germany", "England" |
Implementation Reference
- src/index.ts:209-211 (handler)The handler for get_team — calls the API endpoint /teams/{name} with the country name URL-encoded.
handler: async (args: { name: string }) => api(`/teams/${encodeURIComponent(args.name)}`), }, - src/index.ts:206-208 (schema)Zod schema for get_team — requires a 'name' string (min 2 chars) with no extra properties.
schema: z.object({ name: z.string().min(2).describe('Country name, e.g. "Brazil", "West Germany", "England"'), }).strict(), - src/index.ts:199-211 (registration)The 'get_team' tool is registered as part of the 'tools' array (line 113) with name, description, schema, and handler.
{ name: 'get_team', description: 'Cross-tournament summary for a national team: every appearance, final position by ' + 'year, total titles, knockout records. Use this for "Brazil\'s World Cup history" ' + 'or "how many times has Argentina reached the final?". For a specific year\'s squad ' + 'use get_team_roster.', schema: z.object({ name: z.string().min(2).describe('Country name, e.g. "Brazil", "West Germany", "England"'), }).strict(), handler: async (args: { name: string }) => api(`/teams/${encodeURIComponent(args.name)}`), }, - src/index.ts:70-91 (helper)The 'api' helper function that the get_team handler calls — sends an authenticated fetch to the Zafronix WC API and returns the JSON response.
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>; }