Skip to main content
Glama
PaddleHQ

Paddle MCP Server

Official
by PaddleHQ

preview_subscription_charge

Preview one-time charges for a subscription to calculate expected transactions before applying changes, without billing the customer.

Instructions

This tool will preview creating a one-time charge for a subscription without billing that charge, typically used for previewing calculations before making changes to a subscription.

One-time charges are non-recurring items. These are price entities where the billingCycle is null.

If successful, the response includes immediateTransaction, nextTransaction, and recurringTransactionDetails to see expected transactions for the changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesPaddle ID of the subscription.
effectiveFromYesWhen one-time charges should be billed.
itemsYesList of one-time charges to bill for. Only prices where the `billingCycle` is `null` may be added. Charge for items that have been added to the catalog by passing the Paddle ID of an existing price entity, or charge for non-catalog items by passing a price object. Non-catalog items can be for existing products, or pass a product object as part of the price to charge for a non-catalog product.
onPaymentFailureNoHow Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.

Implementation Reference

  • The primary handler function implementing the tool logic. It previews a one-time charge on a subscription by calling the Paddle SDK's previewOneTimeCharge method.
    export const previewSubscriptionCharge = async (
      paddle: Paddle,
      params: z.infer<typeof Parameters.previewSubscriptionChargeParameters>,
    ) => {
      try {
        const { subscriptionId, ...updateData } = params;
        const subscription = await paddle.subscriptions.previewOneTimeCharge(subscriptionId, updateData);
        return subscription;
      } catch (error) {
        return error;
      }
    };
  • src/tools.ts:625-636 (registration)
    Tool registration in the tools array, defining method name, human-readable name, description prompt, input parameters schema, and required permissions/actions.
    {
      method: "preview_subscription_charge",
      name: "Preview a one-time charge for a subscription",
      description: prompts.previewSubscriptionChargePrompt,
      parameters: params.previewSubscriptionChargeParameters,
      actions: {
        subscriptions: {
          write: true,
          preview: true,
        },
      },
    },
  • src/api.ts:83-85 (registration)
    Mapping of the tool method constant to its handler function in the PaddleAPI toolMap.
    [TOOL_METHODS.CREATE_SUBSCRIPTION_CHARGE]: funcs.createSubscriptionCharge,
    [TOOL_METHODS.PREVIEW_SUBSCRIPTION_CHARGE]: funcs.previewSubscriptionCharge,
    [TOOL_METHODS.LIST_REPORTS]: funcs.listReports,
  • src/constants.ts:74-77 (registration)
    Constant definition for the tool method string used across registrations and mappings.
    PREVIEW_SUBSCRIPTION_UPDATE: "preview_subscription_update",
    CREATE_SUBSCRIPTION_CHARGE: "create_subscription_charge",
    PREVIEW_SUBSCRIPTION_CHARGE: "preview_subscription_charge",
    LIST_REPORTS: "list_reports",
Behavior4/5

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

The description adds valuable behavioral context beyond the annotations. While annotations indicate it's not read-only and not destructive, the description clarifies that it 'previews... without billing that charge,' explaining the non-destructive nature in practical terms. It also describes the response format ('includes immediateTransaction, nextTransaction, and recurringTransactionDetails'), which is helpful since there's no output schema. However, it doesn't mention rate limits, authentication needs, or error conditions.

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

Conciseness5/5

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

The description is well-structured and concise. The first sentence clearly states the purpose and usage, followed by explanatory details about one-time charges and the response format. Each sentence adds value without redundancy, and the information is front-loaded for quick understanding.

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 (previewing charges with multiple parameters) and the absence of an output schema, the description does a good job of explaining the tool's behavior and response. It covers the purpose, usage, and output structure. However, it could be more complete by mentioning potential errors, authentication requirements, or limitations, which would help the agent use it more effectively.

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?

With 100% schema description coverage, the baseline is 3. The description adds minimal parameter semantics: it clarifies that 'one-time charges are non-recurring items' and that 'billingCycle is null,' which relates to the 'items' parameter. However, it doesn't provide additional context for other parameters like 'effectiveFrom' or 'onPaymentFailure' beyond what's already in the schema.

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

Purpose5/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 creating a one-time charge for a subscription without billing that charge, typically used for previewing calculations before making changes to a subscription.' It specifies the verb ('preview creating'), resource ('one-time charge for a subscription'), and distinguishes it from sibling tools like 'create_subscription_charge' by emphasizing the preview-only nature.

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 explicitly states when to use this tool: 'typically used for previewing calculations before making changes to a subscription.' It also distinguishes it from alternatives by contrasting with 'create_subscription_charge' (implied by the sibling list) and clarifies that it's for 'previewing calculations before making changes,' providing clear guidance on its intended context.

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