Skip to main content
Glama
PaddleHQ

Paddle MCP Server

Official
by PaddleHQ

get_discount

Read-only

Retrieve discount details from Paddle Billing using a discount ID to verify pricing, apply promotions, or manage offers.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
discountIdYesPaddle ID of the discount.

Implementation Reference

  • The main handler function for the 'get_discount' tool. It takes a discountId and optional query parameters, calls the Paddle SDK's paddle.discounts.get method, and returns the discount object or error.
    export const getDiscount = async (paddle: Paddle, params: z.infer<typeof Parameters.getDiscountParameters>) => {
      try {
        const { discountId, ...queryParams } = params;
        const hasQueryParams = Object.keys(queryParams).length > 0;
        const discount = await paddle.discounts.get(discountId, hasQueryParams ? queryParams : undefined);
        return discount;
      } catch (error) {
        return error;
      }
    };
  • src/tools.ts:142-153 (registration)
    Tool definition and registration in the tools array, specifying the method name 'get_discount', description, Zod parameters schema, and required permissions (read/get on discounts).
    {
      method: "get_discount",
      name: "Get a discount",
      description: prompts.getDiscountPrompt,
      parameters: params.getDiscountParameters,
      actions: {
        discounts: {
          read: true,
          get: true,
        },
      },
    },
  • Prompt/description for the get_discount tool, used in tool registration.
    export const getDiscountPrompt = `
    This tool will retrieve a discount from Paddle by its ID.
    `;
  • src/api.ts:68-68 (registration)
    Maps the TOOL_METHODS.GET_DISCOUNT constant ('get_discount') to the getDiscount handler function in the toolMap used by PaddleAPI.
    [TOOL_METHODS.GET_DISCOUNT]: funcs.getDiscount,
  • src/constants.ts:60-60 (registration)
    Constant definition mapping GET_DISCOUNT to the tool method string 'get_discount', used in toolMap and elsewhere.
    GET_DISCOUNT: "get_discount",
Behavior3/5

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

Annotations provide readOnlyHint=true, so the agent knows this is a safe read operation. The description adds minimal context by specifying 'by its ID,' which clarifies the lookup mechanism. However, it doesn't disclose any additional behavioral traits like error handling, authentication needs, rate limits, or what happens if the discount ID doesn't exist.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place without redundancy or unnecessary elaboration.

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

Completeness3/5

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

For a simple read operation with one parameter and readOnlyHint annotation, the description is minimally adequate. However, without an output schema, it doesn't explain what data is returned (e.g., discount details, status, or error formats). Given the tool's simplicity, the description meets basic needs but lacks depth for full contextual understanding.

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 the single parameter 'discountId' fully documented in the schema as 'Paddle ID of the discount.' The description adds no additional meaning beyond this, merely restating that retrieval is 'by its ID.' With high schema coverage, the baseline score of 3 is appropriate.

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 action ('retrieve') and resource ('a discount from Paddle by its ID'), making the purpose unambiguous. However, it doesn't distinguish this tool from other 'get_' siblings like 'get_discount_group' or 'get_customer', which follow the same pattern of retrieving specific resources by ID.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_discounts' (for multiple discounts) and 'get_discount_group' (for related resources), the agent must infer usage from naming conventions alone. No explicit when/when-not instructions or prerequisite information is given.

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