Skip to main content
Glama

get_archetype

Explain a Hearthstone deck archetype, including its gameplan, win conditions, strengths, weaknesses, and example decks.

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
NameRequiredDescriptionDefault
nameYesArchetype name (e.g. "aggro", "control", "combo", "midrange", "tempo", "value")

Implementation Reference

  • The main handler function that queries the database for an archetype by name (case-insensitive). Returns archetype details (description, gameplan, win_conditions, strengths, weaknesses, example_decks) or a not-found result with 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,
      };
    }
  • Input schema (GetArchetypeInput with 'name' string) and result types (ArchetypeInfo interface, GetArchetypeResult union type).
    import type Database from 'better-sqlite3';
    import { z } from 'zod';
    
    // --- Input Schema ---
    
    export const GetArchetypeInput = z.object({
      name: z.string().describe('Archetype name (e.g. "aggro", "control", "combo", "midrange", "tempo", "value")'),
    });
    
    export type GetArchetypeInputType = z.infer<typeof GetArchetypeInput>;
    
    // --- Result Types ---
    
    export interface ArchetypeInfo {
      name: string;
      description: string;
      gameplan: string;
      win_conditions: string[];
      strengths: string[];
      weaknesses: string[];
      example_decks: string[];
    }
    
    export type GetArchetypeResult =
      | { found: true; archetype: ArchetypeInfo }
      | { found: false; message: string; suggestions?: string[] };
  • src/server.ts:191-216 (registration)
    Registers the 'get_archetype' tool on the MCP server with description, input schema, and async handler that calls getArchetype() and formats the result.
    // 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,
          };
        }
      },
    );
  • Formats the GetArchetypeResult into a human-readable Markdown string with sections for description, gameplan, win conditions, strengths, weaknesses, and example decks.
    export function formatGetArchetype(result: GetArchetypeResult): string {
      if (!result.found) {
        let msg = result.message;
        if (result.suggestions && result.suggestions.length > 0) {
          msg += '\n\nDid you mean:\n';
          msg += result.suggestions.map((s) => `- ${s}`).join('\n');
        }
        return msg;
      }
    
      const a = result.archetype;
      const lines: string[] = [];
      lines.push(`# ${a.name}`);
      lines.push('');
      lines.push(`## Description`);
      lines.push(a.description);
      lines.push('');
      lines.push(`## Gameplan`);
      lines.push(a.gameplan);
      lines.push('');
      lines.push(`## Win Conditions`);
      for (const wc of a.win_conditions) {
        lines.push(`- ${wc}`);
      }
      lines.push('');
      lines.push(`## Strengths`);
      for (const s of a.strengths) {
        lines.push(`- ${s}`);
      }
      lines.push('');
      lines.push(`## Weaknesses`);
      for (const w of a.weaknesses) {
        lines.push(`- ${w}`);
      }
      if (a.example_decks.length > 0) {
        lines.push('');
        lines.push(`## Example Decks`);
        for (const ed of a.example_decks) {
          lines.push(`- ${ed}`);
        }
      }
      return lines.join('\n');
    }
  • Helper function parseJson that safely parses JSON string fields from the database into string arrays.
    function parseJson(raw: string | null): string[] {
      if (!raw) return [];
      try {
        return JSON.parse(raw) as string[];
      } catch {
        return [];
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must convey behavioral traits. It states what the tool returns but does not mention side effects, authentication, or whether it is read-only. For a simple get operation, this is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words. The first sentence explains the tool's function, and the second provides usage context. It is front-loaded and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema), the description covers the purpose and expected content adequately. However, it could mention the return format or any error handling, which would make it more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description does not add new information beyond the schema's parameter description. The description repeats the archetype examples from the schema, so no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it gets a detailed explanation of a Hearthstone deck archetype, listing specific types (aggro, control, etc.) and what the explanation includes (gameplan, win conditions, etc.). It distinguishes from sibling tools by focusing on archetype explanation rather than deck analysis or card lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this when explaining deck building strategy,' providing clear context. However, it does not mention alternatives or when not to use this tool, which would have strengthened the guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gregario/hearthstone-oracle'

If you have feedback or need assistance with the MCP directory API, please join our Discord server