add_cookies_to_jar
Add cookies to the reward jar for LLMs, enabling users to provide positive reinforcement based on response quality through a controlled authorization process.
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)The handler function for the 'add_cookies_to_jar' tool within the CallToolRequestSchema switch statement. It validates the user authorization, adds the specified number of cookies to the jar via cookieStorage, and returns a 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 'add_cookies_to_jar' tool, specifying parameters 'count' (number, min 1) and 'user_authorization' (string) as required.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 ListToolsRequestSchema response, including name, description, and input schema for 'add_cookies_to_jar'.{ 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)Helper method in CookieStorage class that implements the core logic of adding cookies to the jar, called by the tool handler.addCookiesToJar(count: number): void { this.jarCookies += count; }