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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:303-313 (handler)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: {} } },
- server.js:46-59 (helper)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' });
- server.js:38-43 (helper)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 }; };