Skip to main content
Glama
jimmcq
by jimmcq

set_price

Define the price per cup of lemonade in the Lemonade Stand game using the 'set_price' tool. Input the game ID and desired price to manage pricing strategies effectively.

Instructions

Set the price per cup of lemonade

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gameIdYesThe game ID
priceYesPrice per cup in dollars

Implementation Reference

  • Handler function for the 'set_price' tool. Updates the game's pricePerCup based on input and sets status to 'selling', then persists the 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 }) }] }; }
  • Input schema for 'set_price' tool defining gameId and price parameters.
    inputSchema: { type: "object", properties: { gameId: { type: "string", description: "The game ID" }, price: { type: "number", description: "Price per cup in dollars" } }, required: ["gameId", "price"] }
  • server.js:260-271 (registration)
    Registration of the 'set_price' tool in the ListTools response, including name, description, and schema.
    { 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"] } },

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