Skip to main content
Glama
jimmcq

Lemonade Stand MCP Server

by jimmcq

start_game

Launch a new lemonade stand business simulation to manage pricing, inventory, and weather conditions in a classic economic game.

Instructions

Start a new lemonade stand game

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'start_game' tool: generates a unique game ID, creates initial game state using createNewGame(), stores it in the games Map, and returns the gameId and state as JSON.
    case 'start_game': {
      const gameId = uuidv4();
      const initialGameState = createNewGame();
      games.set(gameId, initialGameState);
      return {
        content: [{
          type: "text",
          text: JSON.stringify({ gameId, gameState: initialGameState })
        }]
      };
    }
  • server.js:237-244 (registration)
    Registration of the 'start_game' tool in the ListTools response, including its name, description, and empty input schema.
    {
      name: "start_game",
      description: "Start a new lemonade stand game",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • Helper function createNewGame() that initializes the game state with starting money, empty inventory, initial price, weather, and status.
    const createNewGame = () => ({
      day: 1,
      money: 20.00,
      inventory: {
        cups: 0,
        lemons: 0,
        sugar: 0,
        ice: 0
      },
      purchaseHistory: [],  // Keep track of purchases for proper cost calculation
      pricePerCup: 0.25,
      weather: generateWeather(),
      status: 'buying'
    });
  • Helper function generateWeather() used by createNewGame to set initial weather conditions.
    const generateWeather = () => {
      const temp = Math.floor(Math.random() * 40) + 50; // 50-90°F
      const conditions = ['Sunny', 'Partly Cloudy', 'Cloudy', 'Rainy'];
      const condition = conditions[Math.floor(Math.random() * conditions.length)];
      return { temp, condition };
    };

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/jimmcq/Lemonade-Stand-MCP-Server'

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