Skip to main content
Glama
bnookala
by bnookala

check_cookies

Check how many cookies an LLM has earned for positive reinforcement in a jar-based economy system.

Instructions

Check how many cookies the LLM has earned so far

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'check_cookies' tool. It retrieves the collected cookie count and jar status, generates an encouraging status message with emojis, and returns it as text content.
    case "check_cookies": { const count = cookieStorage.getCollectedCount(); const status = cookieStorage.getJarStatus(); const emoji = count === 0 ? "๐Ÿ˜”" : "๐Ÿช"; const encouragement = count === 0 ? "Don't worry, you'll earn some cookies soon!" : count === 1 ? "You're off to a great start!" : count < 5 ? "You're doing well!" : count < 10 ? "Excellent work!" : "You're a cookie champion!"; let statusText = `${emoji} You currently have ${count} cookie${count === 1 ? '' : 's'}! ${encouragement}\n\n`; if (status.isEmpty) { statusText += `๐Ÿšซ **Cookie jar is empty** - no more cookies to earn until refilled!`; } else if (status.isLow) { statusText += `โš ๏ธ **Only ${status.available} cookie${status.available === 1 ? '' : 's'} left in jar** - make them count!`; } else { statusText += `๐Ÿช **${status.available} cookies available** in the jar for future rewards.`; } return { content: [ { type: "text", text: statusText, }, ], }; }
  • src/index.ts:170-176 (registration)
    Registration of the 'check_cookies' tool in the ListTools response, including name, description, and empty input schema.
    name: "check_cookies", description: "Check how many cookies the LLM has earned so far", inputSchema: { type: "object", properties: {}, }, },
  • Input schema for 'check_cookies' tool: an empty object (no parameters required).
    inputSchema: { type: "object", properties: {}, },
  • Helper method in CookieStorage class that returns the number of cookies collected by the LLM.
    getCollectedCount(): number { return this.collectedCookies; }
  • Helper method in CookieStorage class that returns the status of the cookie jar, including collected count, available cookies, and flags for empty/low status.
    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 }; }

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