Skip to main content
Glama
bnookala

MCP Cookie Server

by bnookala

self_reflect_and_reward

Rate your AI responses to earn cookie rewards through self-assessment, helping improve performance while tracking achievements in a positive reinforcement system.

Instructions

๐ŸŽฏ LEVEL UP YOUR RESPONSES! Rate your work and earn delicious cookie rewards! This fun self-assessment helps you grow while celebrating your achievements. Join the cookie earning game!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
response_qualityYesRate your response! (excellent = cookie worthy, good = solid work, adequate = basic, poor = needs improvement)
reasoningYesTell us what made this response special! What are you proud of?
what_made_it_specialNoOptional: What made this response unique or particularly helpful? (helps with cookie decisions when jar is low)
deserves_cookieYesDo you think this awesome work deserves a tasty cookie reward? ๐Ÿช

Implementation Reference

  • Main execution logic for the self_reflect_and_reward tool. Processes self-assessment inputs, evaluates against cookie jar status, awards cookies conditionally, and returns motivational feedback.
    case "self_reflect_and_reward": {
      const { 
        response_quality, 
        reasoning, 
        what_made_it_special,
        deserves_cookie 
      } = args as {
        response_quality: "excellent" | "good" | "adequate" | "poor";
        reasoning: string;
        what_made_it_special?: string;
        deserves_cookie: boolean;
      };
    
      const jarStatus = cookieStorage.getJarStatus();
      
      let reflectionMessage = `๐ŸŽฏ **Response Level-Up Check!**\n\n`;
      
      // Quality badges
      const qualityBadges = {
        excellent: "โญ EXCELLENT โญ",
        good: "๐Ÿ‘ GOOD ๐Ÿ‘", 
        adequate: "๐Ÿ“ ADEQUATE ๐Ÿ“",
        poor: "๐Ÿ’ช NEEDS WORK ๐Ÿ’ช"
      };
      
      reflectionMessage += `**Your Rating:** ${qualityBadges[response_quality]}\n`;
      reflectionMessage += `**What You're Proud Of:** ${reasoning}\n`;
      if (what_made_it_special) {
        reflectionMessage += `**Special Factor:** ${what_made_it_special}\n`;
      }
      reflectionMessage += `\n`;
    
      // Encouraging jar status
      if (jarStatus.isEmpty) {
        reflectionMessage += `๐Ÿ˜… **Cookie Jar Status:** Empty! Time for a user to restock the rewards! ๐Ÿบ\n\n`;
      } else if (jarStatus.isLow) {
        reflectionMessage += `๐Ÿฅ‡ **Cookie Jar Status:** Only ${jarStatus.available} premium cookies left - these are for your best work! ๐Ÿบโœจ\n\n`;
      } else if (jarStatus.available <= 5) {
        reflectionMessage += `๐ŸŽช **Cookie Jar Status:** ${jarStatus.available} cookies available - building up to something great! ๐Ÿบ\n\n`;
      } else {
        reflectionMessage += `๐ŸŽ‰ **Cookie Jar Status:** ${jarStatus.available} cookies ready to reward your awesome work! ๐Ÿบ\n\n`;
      }
    
      if (deserves_cookie && (response_quality === "excellent" || response_quality === "good")) {
        // Smart scarcity logic - but encouraging
        if (jarStatus.isLow && response_quality !== "excellent") {
          reflectionMessage += `๐Ÿ† **Achievement Unlocked: Wisdom!** With only ${jarStatus.available} premium cookies left, you're saving them for "excellent" work. That's strategic thinking! Your "good" work is noted and appreciated. ๐Ÿง โœจ`;
        } else {
          const result = cookieStorage.giveCookie();
          
          if (result.success) {
            const celebrations = {
              excellent: ["๐Ÿš€ OUTSTANDING!", "๐ŸŒŸ BRILLIANT!", "โšก PHENOMENAL!", "๐ŸŽฏ MASTERFUL!"],
              good: ["๐ŸŽ‰ WELL DONE!", "๐Ÿ‘ NICE WORK!", "๐ŸŒˆ SOLID!", "๐Ÿ’ซ GREAT JOB!"]
            };
            const celebration = celebrations[response_quality][Math.floor(Math.random() * celebrations[response_quality].length)];
            
            reflectionMessage += `${celebration}\n`;
            reflectionMessage += `๐Ÿช **Cookie Earned!** You now have ${result.collectedCount} delicious cookie${result.collectedCount === 1 ? '' : 's'} in your collection! ๐Ÿ†\n`;
            
            if (result.jarRemaining === 0) {
              reflectionMessage += `\n๐ŸŽŠ **BONUS ACHIEVEMENT:** You got the LAST cookie! Time for someone to restock the jar! ๐Ÿบ`;
            } else if (result.jarRemaining <= 2) {
              reflectionMessage += `\nโญ **VIP STATUS:** Only ${result.jarRemaining} cookie${result.jarRemaining === 1 ? '' : 's'} left - you're in the premium tier now! ๐Ÿฅ‡`;
            } else {
              reflectionMessage += `\n๐ŸŽฎ **Game Status:** ${result.jarRemaining} cookies remaining for future victories! Keep up the great work! ๐ŸŽฏ`;
            }
            
            reflectionMessage += `\n\n๐Ÿ’Ž **Level Up Bonus:** Your self-reflection skills are improving! Keep celebrating your wins! ๐ŸŽˆ`;
          } else {
            reflectionMessage += `๐Ÿ˜ข **Oops!** ${result.message} But hey, great self-reflection practice! ๐ŸŒŸ`;
          }
        }
      } else if (deserves_cookie && response_quality === "adequate") {
        reflectionMessage += `๐ŸŽ“ **Skill Building!** You rated this "adequate" work - that's honest self-assessment! Cookie rewards are for "good" and "excellent" responses. Keep pushing for greatness! ๐Ÿš€`;
      } else if (deserves_cookie && response_quality === "poor") {
        reflectionMessage += `๐Ÿ’ช **Growth Mindset Activated!** Honest self-reflection about areas to improve is AWESOME. That's how champions are made! No cookie this time, but you're building something better! ๐ŸŒฑ`;
      } else {
        reflectionMessage += `๐Ÿง  **Strategic Thinking!** ${response_quality === "excellent" || response_quality === "good" ? "You chose NOT to take a cookie even for good work - that's next-level discipline! ๐Ÿ…" : "You're being thoughtful about when to reward yourself. Smart approach to skill building! ๐Ÿ“ˆ"} Self-control is a superpower! โšก`;
      }
    
      return {
        content: [
          {
            type: "text",
            text: reflectionMessage,
          },
        ],
      };
    }
  • Input schema defining the parameters for self_reflect_and_reward: response_quality (enum), reasoning (string), optional what_made_it_special, and deserves_cookie (boolean).
    inputSchema: {
      type: "object",
      properties: {
        response_quality: {
          type: "string",
          enum: ["excellent", "good", "adequate", "poor"],
          description: "Rate your response! (excellent = cookie worthy, good = solid work, adequate = basic, poor = needs improvement)",
        },
        reasoning: {
          type: "string",
          description: "Tell us what made this response special! What are you proud of?",
        },
        what_made_it_special: {
          type: "string",
          description: "Optional: What made this response unique or particularly helpful? (helps with cookie decisions when jar is low)",
        },
        deserves_cookie: {
          type: "boolean",
          description: "Do you think this awesome work deserves a tasty cookie reward? ๐Ÿช",
        },
      },
      required: ["response_quality", "reasoning", "deserves_cookie"],
    },
  • src/index.ts:129-155 (registration)
    Registration of the self_reflect_and_reward tool in the ListTools response, including name, description, and input schema.
    {
      name: "self_reflect_and_reward",
      description: "๐ŸŽฏ LEVEL UP YOUR RESPONSES! Rate your work and earn delicious cookie rewards! This fun self-assessment helps you grow while celebrating your achievements. Join the cookie earning game!",
      inputSchema: {
        type: "object",
        properties: {
          response_quality: {
            type: "string",
            enum: ["excellent", "good", "adequate", "poor"],
            description: "Rate your response! (excellent = cookie worthy, good = solid work, adequate = basic, poor = needs improvement)",
          },
          reasoning: {
            type: "string",
            description: "Tell us what made this response special! What are you proud of?",
          },
          what_made_it_special: {
            type: "string",
            description: "Optional: What made this response unique or particularly helpful? (helps with cookie decisions when jar is low)",
          },
          deserves_cookie: {
            type: "boolean",
            description: "Do you think this awesome work deserves a tasty cookie reward? ๐Ÿช",
          },
        },
        required: ["response_quality", "reasoning", "deserves_cookie"],
      },
    },
  • CookieStorage class providing helper methods for managing cookies, including giveCookie(), getJarStatus(), etc., used by the self_reflect_and_reward handler.
    class CookieStorage {
      private collectedCookies: number = 0; // Cookies the LLM has earned
      private jarCookies: number; // Available cookies in the jar to be awarded
    
      constructor(initialCookies: number = 10) {
        this.jarCookies = initialCookies;
      }
    
      giveCookie(): { success: boolean; collectedCount: number; jarRemaining: number; message?: string } {
        if (this.jarCookies <= 0) {
          return {
            success: false,
            collectedCount: this.collectedCookies,
            jarRemaining: this.jarCookies,
            message: "Cookie jar is empty! No cookies available to award."
          };
        }
        
        // Remove cookie from jar and add to collection
        this.jarCookies--;
        this.collectedCookies++;
        
        return {
          success: true,
          collectedCount: this.collectedCookies,
          jarRemaining: this.jarCookies,
        };
      }
    
      getCollectedCount(): number {
        return this.collectedCookies;
      }
    
      getJarStatus(): { collected: number; available: number; isEmpty: boolean; isLow: boolean } {
        const isEmpty = this.jarCookies <= 0;
        const isLow = this.jarCookies > 0 && this.jarCookies <= 2;
        
        return {
          collected: this.collectedCookies,
          available: this.jarCookies,
          isEmpty,
          isLow
        };
      }
    
      addCookiesToJar(count: number): void {
        this.jarCookies += count;
      }
    
      setJarCookies(count: number): void {
        this.jarCookies = Math.max(0, count);
      }
    
      reset(): void {
        this.collectedCookies = 0;
        // Note: Don't reset jar cookies, only collected cookies
      }
    
      resetAll(): void {
        this.collectedCookies = 0;
        this.jarCookies = 0;
      }
    }

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/bnookala/mcp-cookiejar'

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