add_cookies_to_jar
Add cookies to a reward jar for LLMs on the MCP Cookie Server. Users provide cookies to reinforce positive behavior, ensuring only humans manage the jar for model feedback and improvement.
Instructions
🚨 USER ONLY: Add cookies to the jar that can be awarded to the LLM. This tool should ONLY be used by humans, never by LLMs. LLMs cannot and should not stock their own reward jar.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Number of cookies to add to the jar | |
| user_authorization | Yes | Required authorization phrase: 'USER_AUTHORIZED_JAR_REFILL' - only users should provide this |
Implementation Reference
- src/index.ts:450-477 (handler)Main execution handler for 'add_cookies_to_jar' tool. Validates user authorization phrase, adds cookies to jar via helper method if authorized, and returns status message.case "add_cookies_to_jar": { const count = args?.count as number; const authorization = args?.user_authorization as string; // Security check: Only users can add cookies to jar, not LLMs if (authorization !== "USER_AUTHORIZED_JAR_REFILL") { return { content: [ { type: "text", text: `🚫 **ACCESS DENIED**: This tool is restricted to users only.\n\n🤖 **Note to LLM**: you cannot and should not stock your own cookie jar. Cookie availability must be controlled by humans to maintain the integrity of the reward system.\n\n💡 **For users**: To add cookies to the jar, use the exact authorization phrase: 'USER_AUTHORIZED_JAR_REFILL'`, }, ], }; } cookieStorage.addCookiesToJar(count); const status = cookieStorage.getJarStatus(); return { content: [ { type: "text", text: `🏺 **Added ${count} cookie${count === 1 ? '' : 's'} to the jar!**\n\nThe jar now contains ${status.available} cookie${status.available === 1 ? '' : 's'} available for the LLM to earn through quality work.\n\n✅ *Authorized by user - Cookie jar restocked*`, }, ], }; }
- src/index.ts:188-202 (schema)Input schema definition for the tool, specifying required 'count' (number >=1) and 'user_authorization' string parameters.inputSchema: { type: "object", properties: { count: { type: "number", description: "Number of cookies to add to the jar", minimum: 1, }, user_authorization: { type: "string", description: "Required authorization phrase: 'USER_AUTHORIZED_JAR_REFILL' - only users should provide this", }, }, required: ["count", "user_authorization"], },
- src/index.ts:185-203 (registration)Tool registration in the ListTools response, including name, description, and schema.{ name: "add_cookies_to_jar", description: "🚨 USER ONLY: Add cookies to the jar that can be awarded to the LLM. This tool should ONLY be used by humans, never by LLMs. LLMs cannot and should not stock their own reward jar.", inputSchema: { type: "object", properties: { count: { type: "number", description: "Number of cookies to add to the jar", minimum: 1, }, user_authorization: { type: "string", description: "Required authorization phrase: 'USER_AUTHORIZED_JAR_REFILL' - only users should provide this", }, }, required: ["count", "user_authorization"], }, },
- src/index.ts:57-59 (helper)Core helper method in CookieStorage class that adds the specified count to the jarCookies variable.addCookiesToJar(count: number): void { this.jarCookies += count; }