get_archetype
Understand Hearthstone deck archetypes like aggro, control, and combo. Learn gameplans, win conditions, strengths, weaknesses, and example decks to improve deck building strategy.
Instructions
Get a detailed explanation of a Hearthstone deck archetype (aggro, control, combo, midrange, tempo, value). Includes gameplan, win conditions, strengths, weaknesses, and example decks. Use this when explaining deck building strategy.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Archetype name (e.g. "aggro", "control", "combo", "midrange", "tempo", "value") |
Implementation Reference
- src/tools/get-archetype.ts:51-87 (handler)The implementation of the getArchetype handler, which queries the database for archetype details or suggestions.
export function getArchetype( db: Database.Database, input: GetArchetypeInputType, ): GetArchetypeResult { // 1. Exact match (case-insensitive) const row = db .prepare('SELECT * FROM archetypes WHERE LOWER(name) = LOWER(?)') .get(input.name) as ArchetypeRow | undefined; if (row) { return { found: true, archetype: { name: row.name, description: row.description, gameplan: row.gameplan, win_conditions: parseJson(row.win_conditions), strengths: parseJson(row.strengths), weaknesses: parseJson(row.weaknesses), example_decks: parseJson(row.example_decks), }, }; } // 2. Not found — suggest similar entries via LIKE const suggestions = db .prepare('SELECT name FROM archetypes WHERE LOWER(name) LIKE LOWER(?) LIMIT 5') .all(`%${input.name}%`) as Array<{ name: string }>; const suggestionNames = suggestions.map((s) => s.name); return { found: false, message: `No archetype found matching "${input.name}".`, suggestions: suggestionNames.length > 0 ? suggestionNames : undefined, }; } - src/tools/get-archetype.ts:6-8 (schema)The Zod schema for get_archetype input.
export const GetArchetypeInput = z.object({ name: z.string().describe('Archetype name (e.g. "aggro", "control", "combo", "midrange", "tempo", "value")'), }); - src/server.ts:191-216 (registration)The registration of the get_archetype tool in the server.
// 6. get_archetype server.tool( 'get_archetype', 'Get a detailed explanation of a Hearthstone deck archetype (aggro, control, combo, midrange, tempo, value). Includes gameplan, win conditions, strengths, weaknesses, and example decks. Use this when explaining deck building strategy.', GetArchetypeInput.shape, async (params) => { try { const result = getArchetype(db, params); return { content: [ { type: 'text' as const, text: formatGetArchetype(result) }, ], }; } catch (err) { return { content: [ { type: 'text' as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } }, );