search_players
Query player names to retrieve World Cup squad details including team, position, DOB, club, and goals per tournament.
Instructions
Search players by name. Returns every World Cup squad row matching the query, with team, position, DOB, club, and tournament-year goals. Use this when the user mentions a player by name. For a player's full multi-tournament career path use get_player_career.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Name fragment, e.g. "Maradona", "Mbappe", "Klose" | |
| limit | No |
Implementation Reference
- src/index.ts:150-167 (handler)Handler function for the 'search_players' tool. It takes a query string 'q' (min 2 chars) and optional 'limit' (1-50, default 20), constructs query params, and calls the API endpoint /players?q=...&limit=...
{ name: 'search_players', description: 'Search players by name. Returns every World Cup squad row matching the query, ' + 'with team, position, DOB, club, and tournament-year goals. Use this when the user ' + 'mentions a player by name. For a player\'s full multi-tournament career path use ' + 'get_player_career.', schema: z.object({ q: z.string().min(2).describe('Name fragment, e.g. "Maradona", "Mbappe", "Klose"'), limit: z.number().int().min(1).max(50).optional() .describe('Max results (default 20)'), }).strict(), handler: async (args: { q: string; limit?: number }) => { const params = new URLSearchParams({ q: args.q }); if (args.limit) params.set('limit', String(args.limit)); return api(`/players?${params.toString()}`); }, }, - src/index.ts:157-161 (schema)Zod schema for search_players input validation: requires 'q' (string, min 2 chars) and optional 'limit' (integer, 1-50)
schema: z.object({ q: z.string().min(2).describe('Name fragment, e.g. "Maradona", "Mbappe", "Klose"'), limit: z.number().int().min(1).max(50).optional() .describe('Max results (default 20)'), }).strict(), - src/index.ts:150-167 (registration)Tool registration: the tool entry is defined inline in the 'tools' array with name 'search_players', its description, schema, and handler all colocated
{ name: 'search_players', description: 'Search players by name. Returns every World Cup squad row matching the query, ' + 'with team, position, DOB, club, and tournament-year goals. Use this when the user ' + 'mentions a player by name. For a player\'s full multi-tournament career path use ' + 'get_player_career.', schema: z.object({ q: z.string().min(2).describe('Name fragment, e.g. "Maradona", "Mbappe", "Klose"'), limit: z.number().int().min(1).max(50).optional() .describe('Max results (default 20)'), }).strict(), handler: async (args: { q: string; limit?: number }) => { const params = new URLSearchParams({ q: args.q }); if (args.limit) params.set('limit', String(args.limit)); return api(`/players?${params.toString()}`); }, },