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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_cookies"
}
}Input 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 }; }