Skip to main content
Glama
jimmcq
by jimmcq

next_day

Advance to the next day in the Lemonade Stand business simulation game to manage weather changes, adjust pricing strategies, and control inventory.

Instructions

Advance to the next day

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID

Implementation Reference

  • Core handler function implementing the 'next_day' tool logic: advances the game day, generates new weather, resets ice inventory to 0 (melts daily), updates status to 'buying', or ends game after day 14.
    const handleNextDay = (gameState) => { if (gameState.day >= 14) { return { success: true, gameState: { ...gameState, status: 'gameOver' } }; } return { success: true, gameState: { ...gameState, day: gameState.day + 1, weather: generateWeather(), status: 'buying', inventory: { ...gameState.inventory, ice: 0 // ice melts daily } } }; };
  • server.js:283-293 (registration)
    Tool registration in ListTools response, defining name, description, and input schema requiring gameId.
    { name: "next_day", description: "Advance to the next day", inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" } }, required: ["gameId"] } }
  • Dispatch handler in CallToolRequestHandler switch statement: retrieves game state, calls handleNextDay, persists updated state, returns result as JSON.
    case 'next_day': { const nextDayGame = games.get(request.params.arguments?.gameId); if (!nextDayGame) { throw new McpError(ErrorCode.InvalidRequest, "Game not found"); } const nextDayResult = handleNextDay(nextDayGame); if (nextDayResult.success) { games.set(request.params.arguments.gameId, nextDayResult.gameState); } return { content: [{ type: "text", text: JSON.stringify(nextDayResult) }] }; }
  • Input schema definition for 'next_day' tool, specifying required 'gameId' string parameter.
    inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" } }, required: ["gameId"] }

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