get_champion
Retrieve comprehensive TFT champion details including stats, traits, and abilities using exact or partial name matching to provide accurate game information.
Instructions
Get complete details for a specific TFT champion including all stats, traits, and ability description. Supports fuzzy name matching.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Champion name to look up (exact or partial match) |
Implementation Reference
- src/tools/get-champion.ts:121-162 (handler)The getChampion function performs a database lookup to retrieve details for a specific TFT champion, including exact, fuzzy, and suggestion-based matches.
export function getChampion( db: Database.Database, input: GetChampionInputType, ): GetChampionResult { // 1. Exact match (case-insensitive) const exact = db .prepare('SELECT * FROM champions WHERE LOWER(name) = LOWER(?)') .get(input.name) as ChampionRow | undefined; if (exact) { return { found: true, champion: toChampionDetail(db, exact) }; } // 2. Fuzzy match via FTS5 const ftsMatch = db .prepare( `SELECT c.* FROM champions_fts fts JOIN champions c ON c.rowid = fts.rowid WHERE champions_fts MATCH ? ORDER BY fts.rank LIMIT 1`, ) .get(input.name) as ChampionRow | undefined; if (ftsMatch) { return { found: true, champion: toChampionDetail(db, ftsMatch) }; } // 3. Not found — provide suggestions const firstWord = input.name.split(/\s+/)[0]; const suggestions = db .prepare('SELECT name FROM champions WHERE LOWER(name) LIKE LOWER(?) LIMIT 5') .all(`%${firstWord}%`) as Array<{ name: string }>; const suggestionNames = suggestions.map((s) => s.name); return { found: false, message: `No champion found matching "${input.name}".`, suggestions: suggestionNames.length > 0 ? suggestionNames : undefined, }; } - src/tools/get-champion.ts:6-8 (schema)The input schema for the get_champion tool, requiring a champion name string.
export const GetChampionInput = z.object({ name: z.string().describe('Champion name to look up (exact or partial match)'), }); - src/server.ts:67-74 (registration)Registration of the get_champion tool in the main MCP server definition.
// 2. get_champion server.tool( 'get_champion', 'Get complete details for a specific TFT champion including all stats, traits, and ability description. Supports fuzzy name matching.', GetChampionInput.shape, async (params) => { try { const result = getChampion(db, params);