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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:403-435 (handler)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: {}, }, },
- src/index.ts:172-175 (schema)Input schema for 'check_cookies' tool: an empty object (no parameters required).inputSchema: { type: "object", properties: {}, },
- src/index.ts:41-43 (helper)Helper method in CookieStorage class that returns the number of cookies collected by the LLM.getCollectedCount(): number { return this.collectedCookies; }
- src/index.ts:45-55 (helper)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 }; }