check_cookies
Track cookie earnings within the MCP Cookie Server's jar-based economy system, enabling LLMs to monitor rewards for response quality through self-reflection.
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 switch case that implements the core logic of the 'check_cookies' tool. It retrieves the LLM's collected cookie count and current jar status, generates an encouraging message with appropriate emojis, includes jar availability warnings, and returns a formatted text response.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 (schema)The tool schema definition including name, description, and empty input schema (no parameters required), registered as part of the tools list in the ListToolsRequestSchema handler.name: "check_cookies", description: "Check how many cookies the LLM has earned so far", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:213-214 (registration)The server request handler for listing tools (ListToolsRequestSchema), which includes 'check_cookies' in its tools array, effectively registering the tool with the MCP server.}; });