Skip to main content
Glama
PaddleHQ
by PaddleHQ

create_discount_group

Create a discount group in Paddle to organize and manage related discounts under a single name for campaigns, promotions, or team management.

Instructions

This tool will create a new discount group in Paddle.

Discount groups are used to organize and manage related discounts under a group name. Create one when managing multiple discounts together, like for a campaign, promotion, or team.

Ensure you have all the information needed before making the call. Don't fabricate, imagine, or infer details and parameter values unless explicitly asked to. If anything is ambiguous, unknown, or unclear, ask the user for clarification or details before you proceed.

If successful, the response includes a copy of the new discount group entity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of this discount group.

Implementation Reference

  • The handler function that executes the create_discount_group tool logic by creating a discount group using the Paddle SDK.
    export const createDiscountGroup = async (paddle: Paddle, params: z.infer<typeof Parameters.createDiscountGroupParameters>) => { try { const discountGroup = await paddle.discountGroups.create(params); return discountGroup; } catch (error) { return error; } };
  • The MCP tool schema definition, including method, name, description, parameters (Zod schema reference), and required actions permissions.
    method: "create_discount_group", name: "Create a discount group", description: prompts.createDiscountGroupPrompt, parameters: params.createDiscountGroupParameters, actions: { discountGroups: { write: true, create: true, }, }, },
  • src/api.ts:71-71 (registration)
    Registration of the createDiscountGroup handler in the toolMap object used by PaddleAPI to route tool calls.
    [TOOL_METHODS.CREATE_DISCOUNT_GROUP]: funcs.createDiscountGroup,
  • src/toolkit.ts:70-85 (registration)
    Dynamic registration of all tools, including create_discount_group, in the MCP server using this.tool() in a loop over tools array.
    tool.method, tool.description, tool.parameters.shape, annotations, async (arg: unknown, _extra: unknown) => { const result = await this._paddle.run(tool.method, arg); return { content: [ { type: "text" as const, text: String(result), }, ], }; }, );
  • Constant defining the string identifier for the CREATE_DISCOUNT_GROUP tool method.
    CREATE_DISCOUNT_GROUP: "create_discount_group",

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