Skip to main content
Glama
PaddleHQ

Paddle MCP Server

Official
by PaddleHQ

get_subscription

Retrieve a Paddle subscription by ID to view details and optionally include previews of upcoming or recurring transactions.

Instructions

This tool will retrieve a subscription from Paddle by its ID.

Use the include parameter to include related entities in the response:

  • next_transaction: Include an object with a preview of the next transaction for this subscription. May include prorated charges that aren't yet billed and one-time charges.

  • recurring_transaction_details: Include an object with a preview of the recurring transaction for this subscription. This is what the customer can expect to be billed when there are no prorated or one-time charges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscriptionIdYesPaddle ID of the subscription.
includeNoInclude related entities in the response. Use a comma-separated list to specify multiple entities.

Implementation Reference

  • The handler function that implements the core logic of the 'get_subscription' tool. It retrieves a specific subscription using the Paddle SDK by subscription ID, optionally with additional query parameters, and handles errors by returning them.
    export const getSubscription = async (paddle: Paddle, params: z.infer<typeof Parameters.getSubscriptionParameters>) => {
      try {
        const { subscriptionId, ...queryParams } = params;
        const hasQueryParams = Object.keys(queryParams).length > 0;
        const subscription = await paddle.subscriptions.get(subscriptionId, hasQueryParams ? queryParams : undefined);
        return subscription;
      } catch (error) {
        return error;
      }
    };
  • The tool schema definition in the tools array, specifying the method name, description, parameters schema (referencing params.getSubscriptionParameters), and required actions for the 'get_subscription' tool.
    {
      method: "get_subscription",
      name: "Get a subscription",
      description: prompts.getSubscriptionPrompt,
      parameters: params.getSubscriptionParameters,
      actions: {
        subscriptions: {
          read: true,
          get: true,
        },
      },
    },
  • src/api.ts:75-75 (registration)
    Registration of the getSubscription handler function in the toolMap object in PaddleAPI, mapping the TOOL_METHODS.GET_SUBSCRIPTION constant to the function for execution.
    [TOOL_METHODS.GET_SUBSCRIPTION]: funcs.getSubscription,
  • src/constants.ts:67-67 (registration)
    Constant definition for the tool method name 'get_subscription' used in registration and tool definitions.
    GET_SUBSCRIPTION: "get_subscription",

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