Skip to main content
Glama

vibe_learn

Identify and categorize recurring errors with solutions to prevent repeated mistakes. Utilizes pattern recognition to enhance learning and streamline decision-making processes.

Instructions

Pattern recognition system that tracks common errors and solutions to prevent recurring issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (standard categories: Complex Solution Bias, Feature Creep, Premature Implementation, Misalignment, Overtooling, Preference, Success, Other)
mistakeYesOne-sentence description of the learning entry
sessionIdNoOptional session ID for state management
solutionNoHow it was corrected (if applicable)
typeNoType of learning entry

Implementation Reference

  • Primary handler function executing the core logic of the vibe_learn tool: validates input, enforces single-sentence format, checks for duplicates, stores learning entry, and returns category summary.
    export async function vibeLearnTool(input: VibeLearnInput): Promise<VibeLearnOutput> {
      try {
        // Validate input
        if (!input.mistake) {
          throw new Error('Mistake description is required');
        }
        if (!input.category) {
          throw new Error('Mistake category is required');
        }
        const entryType: LearningType = input.type ?? 'mistake';
        if (entryType !== 'preference' && !input.solution) {
          throw new Error('Solution is required for this entry type');
        }
        
        // Enforce single-sentence constraints
        const mistake = enforceOneSentence(input.mistake);
        const solution = input.solution ? enforceOneSentence(input.solution) : undefined;
        
        // Normalize category to one of our standard categories if possible
        const category = normalizeCategory(input.category);
        
        // Check for similar mistake
        const existing = getLearningEntries()[category] || [];
        const alreadyKnown = existing.some(e => isSimilar(e.mistake, mistake));
    
        // Add mistake to log if new
        let entry: LearningEntry | undefined;
        if (!alreadyKnown) {
          entry = addLearningEntry(mistake, category, solution, entryType);
        }
        
        // Get category summaries
        const categorySummary = getLearningCategorySummary();
        
        // Find current tally for this category
        const categoryData = categorySummary.find(m => m.category === category);
        const currentTally = categoryData?.count || 1;
        
        // Get top 3 categories
        const topCategories = categorySummary.slice(0, 3);
    
        return {
          added: !alreadyKnown,
          alreadyKnown,
          currentTally,
          topCategories
        };
      } catch (error) {
        console.error('Error in vibe_learn tool:', error);
        return {
          added: false,
          alreadyKnown: false,
          currentTally: 0,
          topCategories: []
        };
      }
    }
  • TypeScript interfaces defining input and output schemas for the vibe_learn tool.
    export interface VibeLearnInput {
      mistake: string;
      category: string;
      solution?: string;
      type?: LearningType;
      sessionId?: string;
    }
    
    export interface VibeLearnOutput {
      added: boolean;
      currentTally: number;
      alreadyKnown?: boolean;
      topCategories: Array<{
        category: string;
        count: number;
        recentExample: LearningEntry;
      }>;
    }
  • src/index.ts:131-167 (registration)
    Tool registration in the MCP listTools handler, including name, description, and JSON schema for input validation.
      name: 'vibe_learn',
      description: 'Pattern recognition system that tracks common errors and solutions to prevent recurring issues',
      inputSchema: {
        type: 'object',
        properties: {
          mistake: {
            type: 'string',
            description: 'One-sentence description of the learning entry',
            examples: ['Skipped writing tests']
          },
          category: {
            type: 'string',
            description: `Category (standard categories: ${STANDARD_CATEGORIES.join(', ')})`,
            enum: STANDARD_CATEGORIES,
            examples: ['Premature Implementation']
          },
          solution: {
            type: 'string',
            description: 'How it was corrected (if applicable)',
            examples: ['Added regression tests']
          },
          type: {
            type: 'string',
            enum: ['mistake', 'preference', 'success'],
            description: 'Type of learning entry',
            examples: ['mistake']
          },
          sessionId: {
            type: 'string',
            description: 'Optional session ID for state management',
            examples: ['session-123']
          }
        },
        required: ['mistake', 'category'],
        additionalProperties: false
      }
    },
  • MCP protocol handler for callTool requests to 'vibe_learn': parses arguments, validates, calls vibeLearnTool, formats output.
    case 'vibe_learn': {
      const missing: string[] = [];
      if (!args || typeof args.mistake !== 'string') missing.push('mistake');
      if (!args || typeof args.category !== 'string') missing.push('category');
      if (missing.length) {
        const example = '{"mistake":"Skipped tests","category":"Feature Creep"}';
        const message = IS_DISCOVERY
          ? `discovery: missing [${missing.join(', ')}]; example: ${example}`
          : `Missing: ${missing.join(', ')}. Example: ${example}`;
        throw new McpError(ErrorCode.InvalidParams, message);
      }
      const input: VibeLearnInput = {
        mistake: args.mistake,
        category: args.category,
        solution: typeof args.solution === 'string' ? args.solution : undefined,
        type: ['mistake', 'preference', 'success'].includes(args.type as string)
          ? (args.type as LearningType)
          : undefined,
        sessionId: typeof args.sessionId === 'string' ? args.sessionId : undefined
      };
      const result = await vibeLearnTool(input);
      return { content: [{ type: 'text', text: formatVibeLearnOutput(result) }] };
    }
  • Supporting helper functions used by the handler: enforceOneSentence for input normalization, isSimilar for duplicate detection, normalizeCategory for standardization.
    }
    
    /**
     * Ensure text is a single sentence
     */
    function enforceOneSentence(text: string): string {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions tracking and prevention but fails to detail critical aspects like whether this is a read/write operation, data persistence, permissions needed, or error handling. This leaves significant gaps for a tool with 5 parameters and potential data mutation.

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 a single, efficient sentence that directly states the tool's purpose without redundancy or unnecessary details. It is front-loaded and appropriately sized for its informational content.

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

Completeness2/5

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

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, output expectations, and differentiation from siblings, making it inadequate for guiding an agent in practical use beyond a high-level purpose.

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?

The schema description coverage is 100%, providing clear documentation for all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 without compensating or enhancing the schema's information.

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

Purpose4/5

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

The description clearly states the tool's purpose as a 'pattern recognition system that tracks common errors and solutions to prevent recurring issues,' which specifies the verb (tracks) and resource (errors/solutions). However, it doesn't explicitly differentiate from its sibling 'vibe_check,' leaving room for ambiguity about their distinct roles.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, including its sibling 'vibe_check.' It lacks context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on the purpose alone.

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

Related 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/PV-Bhat/vibe-check-mcp-server'

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