Skip to main content
Glama
jimmcq
by jimmcq

next_day

Advance to the next day in the Lemonade Stand game by submitting the game ID. Manage dynamic weather, pricing, and inventory for optimal business growth.

Instructions

Advance to the next day

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID

Implementation Reference

  • Core handler function that executes the 'next_day' tool logic: advances the game day, generates new weather, resets ice inventory to 0, and sets game over if 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)
    Registration of the 'next_day' tool in the ListTools response, including 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"] } }
  • MCP CallToolRequest handler for 'next_day': retrieves game state, calls handleNextDay, updates games map, and returns result as JSON text content.
    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 for the 'next_day' tool: requires gameId string.
    inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" } }, required: ["gameId"] }

Other Tools

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

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