Skip to main content
Glama
bnookala
by bnookala

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
NameRequiredDescriptionDefault
countYesNumber of cookies to add to the jar
user_authorizationYesRequired authorization phrase: 'USER_AUTHORIZED_JAR_REFILL' - only users should provide this

Implementation Reference

  • 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*`, }, ], }; }
  • 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"], }, },
  • 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; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bnookala/mcp-cookiejar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server