Skip to main content
Glama
bnookala

MCP Cookie Server

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;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool is for user-only operations (implying permission/authorization needs) and involves adding rewards (mutative action). However, it doesn't mention potential side effects like rate limits or what happens if the jar overflows.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: it starts with the core purpose and immediately follows with critical usage restrictions. Every sentence adds value without redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides good context for a mutative tool: it clarifies the user-only restriction and purpose. However, it lacks details on what happens after adding cookies (e.g., confirmation message, error cases) or how this tool differs from siblings like 'give_cookie'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('count' and 'user_authorization') with descriptions. The description doesn't add meaning beyond this, such as explaining why 'user_authorization' is required or how 'count' interacts with the jar's capacity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add cookies to the jar') and resource ('jar'), specifying it's for awarding to the LLM. However, it doesn't distinguish this from sibling tools like 'give_cookie' or 'self_reflect_and_reward', which might have overlapping purposes related to cookies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: 'This tool should ONLY be used by humans, never by LLMs. LLMs cannot and should not stock their own reward jar.' This clearly defines when to use (by humans) and when not to use (by LLMs), addressing alternatives implicitly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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