get_price
Retrieve pricing information from Paddle by ID, with optional product details for accurate billing and financial management.
Instructions
This tool will retrieve a price from Paddle by its ID.
Use the include parameter to include related entities in the response:
product: An object for the product entity tied to the price.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| priceId | Yes | Paddle ID of the price. | |
| include | No | Include related entities in the response. |
Implementation Reference
- src/functions.ts:100-109 (handler)The main handler function that executes the 'get_price' tool logic. It destructures the priceId and optional query parameters from input, calls the Paddle SDK's prices.get method, and returns the price or error.export const getPrice = async (paddle: Paddle, params: z.infer<typeof Parameters.getPriceParameters>) => { try { const { priceId, ...queryParams } = params; const hasQueryParams = Object.keys(queryParams).length > 0; const price = await paddle.prices.get(priceId, hasQueryParams ? queryParams : undefined); return price; } catch (error) { return error; } };
- src/tools.ts:94-105 (registration)Tool registration definition in the tools array, specifying the method name 'get_price', human-readable name, description prompt reference, Zod parameters schema reference, and required permissions (prices read/get). This is used by the MCP server to register the tool.{ method: "get_price", name: "Get a price", description: prompts.getPricePrompt, parameters: params.getPriceParameters, actions: { prices: { read: true, get: true, }, }, },
- src/api.ts:16-16 (registration)Maps the GET_PRICE constant to the getPrice handler function in the toolMap used by PaddleAPI to dispatch tool calls to the correct implementation.[TOOL_METHODS.GET_PRICE]: funcs.getPrice,
- src/constants.ts:8-8 (registration)Constant definition mapping GET_PRICE symbol to the string 'get_price' used in tool registrations and mappings.GET_PRICE: "get_price",