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;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes a 'fun self-assessment' and 'cookie rewards', hinting at a non-destructive, playful interaction, but it fails to disclose critical traits such as whether this tool modifies any state (e.g., updates a cookie count), requires authentication, has rate limits, or what the output looks like. The description adds minimal behavioral context beyond the basic premise.

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

Conciseness4/5

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

The description is appropriately sized with three sentences that are front-loaded with the core idea ('šŸŽÆ LEVEL UP YOUR RESPONSES!'), followed by motivational elements. It avoids unnecessary verbosity, though the playful tone ('delicious cookie rewards', 'cookie earning game') might be slightly distracting. Overall, it's efficient and structured for its purpose.

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 complexity of a 4-parameter tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, output format, and how it integrates with sibling tools. While the schema covers parameters, the description doesn't provide enough context for an agent to fully understand the tool's role and effects, especially in a server with cookie-related siblings.

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 description coverage is 100%, so the input schema already documents all parameters thoroughly with descriptions and enums. The description does not add any meaning beyond what the schema provides; it mentions 'rate your work' and 'cookie rewards' but doesn't elaborate on parameter usage or semantics. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

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

The description states the tool is for self-assessment and earning rewards, which gives a vague purpose ('Rate your work and earn delicious cookie rewards'), but it doesn't specify the exact action or resource clearly. It distinguishes from siblings by focusing on self-reflection rather than cookie management, but the purpose is somewhat abstract and not tied to a concrete verb+resource combination.

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 mentions 'helps you grow while celebrating your achievements' and 'Join the cookie earning game!', which implies usage for self-improvement and reward, but it provides no explicit guidance on when to use this tool versus alternatives like 'check_cookies' or 'give_cookie'. There is no mention of prerequisites, timing, or exclusions, leaving the agent to infer context without clear direction.

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

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