Skip to main content
Glama
PaddleHQ

Paddle MCP Server

Official
by PaddleHQ

create_customer_portal_session

Generate authenticated customer portal links for Paddle customers to manage subscriptions, view transactions, update payment methods, and download invoices securely.

Instructions

This tool will create a customer portal session for a customer in Paddle.

The customer portal is a secure, Paddle-hosted site that allows customers and authorized individuals to:

  • View transaction history

  • Download invoices

  • Update saved payment methods for future purchases

  • Update stored payment methods for subscriptions

  • Manage their subscriptions including cancellations

  • Revise details on completed transactions

Don't use this tool without checking with the user first. Avoid using before gaining explicit approval.

Authenticated links are returned which automatically sign in the customer. Ensure those creating a customer portal session are authorized to access the customer portal.

  • urls.general.overview: Allows the customer to view their account information, transactions, and subscriptions.

Provide subscriptionIds to return urls.subscriptions[] to manage one or more subscriptions directly:

  • urls.subscriptions[].updateSubscriptionPaymentMethod: Allows the customer to update the payment method for a subscription.

  • urls.subscriptions[].cancelSubscription: Allows the customer to cancel a subscription.

If subscriptions are paused or canceled, links open the overview page for a subscription.

If successful, the response includes a copy of the new customer portal session entity with the urls to open up the customer portal for access. Customer portal sessions are temporary and shouldn't be cached.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesPaddle ID of the customer.
subscriptionIdsYesList of subscriptions to create authenticated customer portal deep links for.

Implementation Reference

  • The main handler function implementing the tool logic: extracts customerId and optional subscriptionIds, calls Paddle SDK's customerPortalSessions.create, and returns the session or error.
    export const createCustomerPortalSession = async (
      paddle: Paddle,
      params: z.infer<typeof Parameters.createCustomerPortalSessionParameters>,
    ) => {
      try {
        const { customerId, subscriptionIds } = params;
        const customerPortalSession = await paddle.customerPortalSessions.create(customerId, subscriptionIds);
        return customerPortalSession;
      } catch (error) {
        return error;
      }
    };
  • src/tools.ts:674-684 (registration)
    Registers the MCP tool with method name, human-readable name, prompt description, input schema (parameters), and required permissions/actions.
      method: "create_customer_portal_session",
      name: "Create a customer portal session",
      description: prompts.createCustomerPortalSessionPrompt,
      parameters: params.createCustomerPortalSessionParameters,
      actions: {
        customerPortalSessions: {
          write: true,
          create: true,
        },
      },
    },
  • src/api.ts:44-44 (registration)
    In the toolMap, maps the tool method constant to the imported handler function for execution in PaddleAPI.
    [TOOL_METHODS.CREATE_CUSTOMER_PORTAL_SESSION]: funcs.createCustomerPortalSession,
  • src/constants.ts:36-36 (registration)
    Constant definition for the tool method string identifier used across the codebase.
    CREATE_CUSTOMER_PORTAL_SESSION: "create_customer_portal_session",
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 the tool returns authenticated links that automatically sign in the customer, specifies that sessions are temporary and shouldn't be cached, and details what happens for paused/canceled subscriptions. This enhances understanding of the tool's behavior without contradicting annotations.

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 with clear sections: purpose, portal capabilities, usage warnings, authorization notes, URL details, and behavioral notes. While comprehensive, some sentences could be more concise (e.g., the list of portal capabilities is lengthy but informative). Overall, it's front-loaded with key information and avoids redundancy.

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 (creating authenticated sessions with security implications), the description provides substantial context: it covers purpose, usage guidelines, behavioral traits, and output details (URLs and session entity). However, without an output schema, it doesn't fully document the response structure (e.g., exact fields in the 'new customer portal session entity'). This minor gap prevents a perfect score.

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%, with clear documentation for both parameters (customerId and subscriptionIds). The description adds some semantic context by explaining that subscriptionIds create 'authenticated customer portal deep links' and affect the returned URLs, but this is marginal beyond what the schema already provides. The baseline score of 3 is appropriate given the high schema coverage.

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 specific action ('create a customer portal session') and resource ('for a customer in Paddle'), distinguishing it from sibling tools like 'create_customer' or 'create_client_side_token' which perform different operations. It provides concrete examples of what the portal enables, making the purpose unambiguous.

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 ('Don't use this tool without checking with the user first. Avoid using before gaining explicit approval') and provides prerequisites ('Ensure those creating a customer portal session are authorized to access the customer portal'). It also implies alternatives by specifying what the portal does, helping differentiate from direct API calls for individual actions like managing subscriptions.

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