get_pricing_estimate
Calculate per-component costs and total pricing for tabletop games at different order quantities to plan manufacturing budgets.
Instructions
Get per-component cost breakdown and total price for a game at various order quantities. The game must have components added first via add_component_to_game. Requires authentication.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game_id | Yes | The game ID to get pricing for. The game must have components added. |
Implementation Reference
- src/tools/pricing.ts:4-47 (handler)The handler implementation for the `get_pricing_estimate` tool. It retrieves game ledger entries or falls back to basic game object pricing details.
export function handleGetPricingEstimate(client: TgcClient) { return async (args: { game_id: string }): Promise<CallToolResult> => { const [entries, game] = await Promise.all([ client.getGameLedgerEntries(args.game_id), client.getGame(args.game_id), ]); if (entries.length > 0) { return { content: [ { type: "text", text: `Ledger entries:\n${JSON.stringify(entries, null, 2)}`, }, ], }; } // Fallback: extract pricing from the game object itself const pricing = { game_id: game.id, name: game.name, cost: game.cost, price_1: game.price1 ?? game.price, price_10: game.price10, price_100: game.price100, price_500: game.price500, price_1000: game.price1000, retail_price_each: game.retail_price_each, msrp: game.msrp, designer_profit: game.designer_profit, component_list: game.component_list, }; return { content: [ { type: "text", text: `No ledger entries available. Pricing summary from game details:\n\n${JSON.stringify(pricing, null, 2)}`, }, ], }; }; } - src/schemas/tool-inputs.ts:115-119 (schema)Input schema definition for `get_pricing_estimate`.
export const getPricingEstimateInput = { game_id: safeId.describe( "The game ID to get pricing for. The game must have components added.", ), }; - src/index.ts:134-140 (registration)Tool registration for `get_pricing_estimate` in the main server file.
server.registerTool("get_pricing_estimate", { description: "Get per-component cost breakdown and total price for a game at various order quantities. The game must have components added first via add_component_to_game. Requires authentication.", inputSchema: schemas.getPricingEstimateInput, annotations: { readOnlyHint: true }, }, withErrorHandling(handleGetPricingEstimate(client)));