Skip to main content
Glama
PaddleHQ
by PaddleHQ

preview_prices

Preview price calculations with tax and currency localization by providing location details like customer IP, address, or existing customer data.

Instructions

This tool will preview price calculations for one or more prices.

Consider using the preview_transaction_create tool for more advanced and accurate pricing calculations or for all manually-collected invoiced transactions.

Providing location information when previewing prices allows Paddle to calculate tax or automatically localize prices. Provide one of the following:

  • customer_ip_address: Paddle fetches location using the IP address to calculate totals.

  • address: Paddle uses the country and ZIP code (where supplied) to calculate totals.

  • customerId, addressId, businessId: Paddle uses existing customer data to calculate totals. Typically used for logged-in customers.

Each line item includes formattedUnitTotals and formattedTotals objects that return totals formatted for the country or region being worked with, including the currency symbol.

If successful, the response includes the data sent with a details object that includes totals for the supplied prices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdNoPaddle ID of the customer that this preview is for, prefixed with `ctm_`.
addressIdNoPaddle ID of the address that this preview is for, prefixed with `add_`. Send one of `addressId`, `customerIpAddress`, or the `address` object when previewing.
businessIdNoPaddle ID of the business that this preview is for, prefixed with `biz_`.
currencyCodeNoSupported three-letter ISO 4217 currency code.
discountIdNoPaddle ID of the discount applied to this preview, prefixed with `dsc_`.
addressNoAddress for this preview. Send one of `addressId`, `customerIpAddress`, or the `address` object when previewing.
customerIpAddressNoIP address for this transaction preview. Send one of `addressId`, `customerIpAddress`, or the `address` object when previewing.
itemsYesList of items to preview price calculations for.

Implementation Reference

  • The async handler function that executes the preview_prices tool by calling paddle.pricingPreview.preview(params) and handling errors.
    export const previewPrices = async (paddle: Paddle, params: z.infer<typeof Parameters.previewPricesParameters>) => { try { const pricingPreview = await paddle.pricingPreview.preview(params); return pricingPreview; } catch (error) { return error; } };
  • Tool schema definition including method name, description from prompts, Zod input parameters schema, and required actions for permissions.
    method: "preview_prices", name: "Preview prices", description: prompts.previewPricesPrompt, parameters: params.previewPricesParameters, actions: { pricingpreview: { write: true, preview: true, }, }, },
  • src/api.ts:20-20 (registration)
    Registration of the preview_prices tool in the toolMap, mapping TOOL_METHODS.PREVIEW_PRICES to the previewPrices handler function.
    [TOOL_METHODS.PREVIEW_PRICES]: funcs.previewPrices,
  • Constant definition for the preview_prices tool method string used in registration and tool definitions.
    PREVIEW_PRICES: "preview_prices",

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/PaddleHQ/paddle-mcp-server'

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