Skip to main content
Glama

explain_concept

Get clear explanations of Hearthstone game concepts like tempo, card advantage, and mana curve with definitions tailored specifically to Hearthstone gameplay.

Instructions

Explain a fundamental Hearthstone game concept like card advantage, tempo, value, board control, or mana curve. Includes how the concept applies specifically to Hearthstone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesGame concept name (e.g. "tempo", "card advantage", "mana curve")

Implementation Reference

  • The main handler function that queries the database for a game concept by name, returning either the concept info or suggestions if not found.
    export function explainConcept(
      db: Database.Database,
      input: ExplainConceptInputType,
    ): ExplainConceptResult {
      // Exact match (case-insensitive)
      const row = db
        .prepare('SELECT * FROM game_concepts WHERE LOWER(name) = LOWER(?)')
        .get(input.name) as ConceptInfo | undefined;
    
      if (row) {
        return {
          found: true,
          concept: {
            name: row.name,
            category: row.category,
            description: row.description,
            hearthstone_application: row.hearthstone_application,
          },
        };
      }
    
      // Not found — suggest similar entries via LIKE
      const suggestions = db
        .prepare('SELECT name FROM game_concepts 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 game concept found matching "${input.name}".`,
        suggestions: suggestionNames.length > 0 ? suggestionNames : undefined,
      };
    }
  • Input schema (zod) and result types for the explain_concept tool. Input requires a 'name' string; result is either found (ConceptInfo) or not found (message + suggestions).
    export const ExplainConceptInput = z.object({
      name: z.string().describe('Game concept name (e.g. "tempo", "card advantage", "mana curve")'),
    });
    
    export type ExplainConceptInputType = z.infer<typeof ExplainConceptInput>;
    
    // --- Result Types ---
    
    export interface ConceptInfo {
      name: string;
      category: string;
      description: string;
      hearthstone_application: string;
    }
    
    export type ExplainConceptResult =
      | { found: true; concept: ConceptInfo }
      | { found: false; message: string; suggestions?: string[] };
  • src/server.ts:275-301 (registration)
    Registration of the 'explain_concept' tool on the MCP server, wiring up the input schema and calling the handler.
    // 9. explain_concept
    server.tool(
      'explain_concept',
      'Explain a fundamental Hearthstone game concept like card advantage, tempo, value, board control, or mana curve. Includes how the concept applies specifically to Hearthstone.',
      ExplainConceptInput.shape,
      async (params) => {
        try {
          const result = explainConcept(db, params);
          return {
            content: [
              {
                type: 'text' as const,
                text: formatExplainConcept(result),
              },
            ],
          };
        } catch (err) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${err instanceof Error ? err.message : String(err)}`,
              },
            ],
            isError: true,
          };
        }
  • Formats the ExplainConceptResult into a human-readable markdown string for display.
    export function formatExplainConcept(result: ExplainConceptResult): 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 c = result.concept;
      const lines: string[] = [];
      lines.push(`## ${c.name}`);
      lines.push('');
      lines.push(`**Category:** ${c.category}`);
      lines.push('');
      lines.push(c.description);
      lines.push('');
      lines.push(`**In Hearthstone:** ${c.hearthstone_application}`);
      return lines.join('\n');
Behavior3/5

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

Description indicates it provides explanations without side effects, but lacks details on output format, error handling, or response behavior. No annotations to supplement.

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?

Two sentences efficiently convey purpose and context with no redundancy. Front-loaded with action and examples.

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

Completeness5/5

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

For a simple one-parameter tool with no output schema, the description is complete enough: states what it does and what kind of concepts it covers.

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 already fully describes the 'name' parameter (100% coverage). The tool description adds only examples, providing minimal extra value.

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?

Clearly states the tool explains Hearthstone game concepts like card advantage, tempo, etc., distinguishing it from sibling tools such as get_keyword which focuses on keyword definitions.

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

Usage Guidelines3/5

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

Implied usage from examples, but no explicit guidance on when to use this tool vs. alternatives like get_keyword or when not to use it.

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