Skip to main content
Glama
PaddleHQ

Paddle MCP Server

Official
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",
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate readOnlyHint=false and destructiveHint=false, but the description adds valuable behavioral context beyond this. It explains that providing location information enables tax calculation and price localization, describes how formatted totals are returned in the response, and specifies that successful responses include a 'details' object with totals. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It starts with the core purpose, then provides usage guidelines, parameter context, and response details. Most sentences add value, though some information (like the formatted totals explanation) could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, tax calculation logic) and lack of output schema, the description does a good job explaining key aspects: purpose, when to use alternatives, location parameter significance, and response format. However, it could better explain the relationship between items and prices or provide more detail about error cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds some semantic context by explaining the purpose of location parameters (customer_ip_address, address, customerId/addressId/businessId) for tax calculation and localization, but doesn't provide significant additional meaning beyond what's in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'preview price calculations for one or more prices.' It specifies the verb ('preview') and resource ('price calculations'), but doesn't explicitly differentiate from sibling tools like 'preview_subscription_charge' or 'preview_transaction_create' beyond mentioning the latter as an alternative for advanced calculations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool versus alternatives: 'Consider using the preview_transaction_create tool for more advanced and accurate pricing calculations or for all manually-collected invoiced transactions.' It also details context for location-based calculations, specifying three scenarios (customer_ip_address, address, customerId/addressId/businessId) and their typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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