get_class_identity
Get the strategic identity of a Hearthstone class: hero power implications, historical archetypes, strengths, weaknesses, and game phase approach. Omit class name for all 11 classes overview.
Instructions
Get the strategic identity of a Hearthstone class — hero power implications, historical archetypes, strengths, weaknesses, and how the class approaches each game phase. Omit the class name to get an overview of all 11 classes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| class_name | No | Class name (e.g. "Mage", "Warrior"). Omit to get an overview of all classes. |
Implementation Reference
- src/tools/get-class-identity.ts:88-129 (handler)Main handler function for get_class_identity tool. Accepts an optional class_name, queries the SQLite database for class identity info, and returns either an overview, detailed identity, or a not-found message with suggestions.
export function getClassIdentity( db: Database.Database, input: GetClassIdentityInputType, ): GetClassIdentityResult { // If no class_name provided, return overview of all classes if (!input.class_name) { const rows = db .prepare('SELECT class, identity, hero_power_name FROM class_identities ORDER BY class') .all() as ClassOverviewEntry[]; return { found: true, overview: true, classes: rows, }; } // Single class lookup (case-insensitive) const row = db .prepare('SELECT * FROM class_identities WHERE LOWER(class) = LOWER(?)') .get(input.class_name) as ClassIdentityRow | undefined; if (row) { return { found: true, identity: toClassIdentityInfo(row), }; } // Not found — suggest similar entries via LIKE const suggestions = db .prepare('SELECT class FROM class_identities WHERE LOWER(class) LIKE LOWER(?) LIMIT 5') .all(`%${input.class_name}%`) as Array<{ class: string }>; const suggestionNames = suggestions.map((s) => s.class); return { found: false, message: `No class found matching "${input.class_name}".`, suggestions: suggestionNames.length > 0 ? suggestionNames : undefined, }; } - src/tools/get-class-identity.ts:6-11 (schema)Input schema for get_class_identity using Zod. Optional 'class_name' field describing the class to look up.
export const GetClassIdentityInput = z.object({ class_name: z .string() .optional() .describe('Class name (e.g. "Mage", "Warrior"). Omit to get an overview of all classes.'), }); - Result type definitions: ClassIdentityInfo (full details), ClassOverviewEntry (summary), and GetClassIdentityResult (discriminated union).
export interface ClassIdentityInfo { class: string; identity: string; hero_power_name: string; hero_power_cost: number; hero_power_effect: string; hero_power_implications: string; historical_archetypes: string[]; strengths: string[]; weaknesses: string[]; early_game: string; mid_game: string; late_game: string; } export interface ClassOverviewEntry { class: string; identity: string; hero_power_name: string; } export type GetClassIdentityResult = | { found: true; identity: ClassIdentityInfo } | { found: true; overview: true; classes: ClassOverviewEntry[] } | { found: false; message: string; suggestions?: string[] }; - src/server.ts:218-233 (registration)Registration of get_class_identity as an MCP tool via server.tool(...), wired to GetClassIdentityInput shape and getClassIdentity handler.
// 7. get_class_identity server.tool( 'get_class_identity', 'Get the strategic identity of a Hearthstone class — hero power implications, historical archetypes, strengths, weaknesses, and how the class approaches each game phase. Omit the class name to get an overview of all 11 classes.', GetClassIdentityInput.shape, async (params) => { try { const result = getClassIdentity(db, params); return { content: [ { type: 'text' as const, text: formatGetClassIdentity(result), }, ], }; - Helper function toClassIdentityInfo that maps a DB row to the ClassIdentityInfo interface, parsing JSON fields like historical_archetypes, strengths, and weaknesses.
} // --- Handler --- interface ClassIdentityRow { class: string; identity: string; hero_power_name: string; hero_power_cost: number; hero_power_effect: string; hero_power_implications: string; historical_archetypes: string; strengths: string; weaknesses: string; early_game: string; mid_game: string; late_game: string; } function toClassIdentityInfo(row: ClassIdentityRow): ClassIdentityInfo {