Skip to main content
Glama
jimmcq
by jimmcq

set_price

Adjust the cost per cup of lemonade in the Lemonade Stand business simulation to optimize revenue based on weather conditions and customer demand.

Instructions

Set the price per cup of lemonade

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID
priceYesPrice per cup in dollars

Implementation Reference

  • Handler for the 'set_price' tool. Retrieves the game state, validates existence, updates pricePerCup from arguments, sets status to 'selling', persists the state, and returns success with updated game state.
    case 'set_price': { const priceGame = games.get(request.params.arguments?.gameId); if (!priceGame) { throw new McpError(ErrorCode.InvalidRequest, "Game not found"); } priceGame.pricePerCup = parseFloat(request.params.arguments.price); priceGame.status = 'selling'; games.set(request.params.arguments.gameId, priceGame); return { content: [{ type: "text", text: JSON.stringify({ success: true, gameState: priceGame }) }] }; }
  • server.js:260-271 (registration)
    Tool registration in ListTools response, including name, description, and input schema for 'set_price'.
    { name: "set_price", description: "Set the price per cup of lemonade", inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" }, price: { type: "number", description: "Price per cup in dollars" } }, required: ["gameId", "price"] } },
  • Input schema definition for the 'set_price' tool, specifying gameId (string, required) and price (number, required).
    inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" }, price: { type: "number", description: "Price per cup in dollars" } }, required: ["gameId", "price"] }

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