start_game
Initiate a lemonade stand simulation game with dynamic weather, pricing strategies, and inventory management through the MCP server.
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 using uuidv4, creates initial game state with createNewGame(), stores it in the games Map, and returns the gameId and initial state as JSON text content.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 (no parameters required).{ name: "start_game", description: "Start a new lemonade stand game", inputSchema: { type: "object", properties: {} } },
- server.js:240-243 (schema)Input schema for 'start_game' tool, defining it as an object with no properties (parameterless tool).inputSchema: { type: "object", properties: {} }
- server.js:46-59 (helper)Helper function called by the start_game handler to initialize the new game state with starting values, empty inventory, default price, generated weather, and 'buying' 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 used indirectly via createNewGame to generate random initial weather conditions (temperature 50-90°F and one of four 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 }; };