Skip to main content
Glama
PaddleHQ
by PaddleHQ

list_businesses

Retrieve and filter businesses for a specific Paddle customer, with options for pagination, search by name or tax details, and status filtering.

Instructions

This tool will list businesses for a customer in Paddle.

Use the maximum perPage by default (200) to ensure comprehensive results. Filter businesses by id, search (fuzzy search on the business's name or tax or VAT number), and status as needed. Results are paginated - use the 'after' parameter with the last ID from previous results to get the next page. Sort and order results using the orderBy parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesPaddle ID of the customer.
afterNoReturn entities after the specified Paddle ID when working with paginated endpoints.
idNoReturn only the IDs specified. Use a comma-separated list to get multiple entities.
orderByNoOrder returned entities by the specified field and direction.
perPageNoSet how many entities are returned per page. Returns the maximum number of results if a number greater than the maximum is requested.
searchNoReturn entities that match a search query. Pass an exact match for the business's name or tax or VAT number.
statusNoReturn entities that match the specified status. Use a comma-separated list to specify multiple status values.

Implementation Reference

  • The handler function for the 'list_businesses' tool. It lists businesses associated with a customer using the Paddle SDK's businesses.list method, handles the first page of results, extracts pagination data, and returns the businesses with pagination info. Catches and returns any errors.
    export const listBusinesses = async (paddle: Paddle, params: z.infer<typeof Parameters.listBusinessesParameters>) => { try { const { customerId, ...queryParams } = params; const collection = paddle.businesses.list(customerId, queryParams); const businesses = await collection.next(); const pagination = paginationData(collection); return { pagination, businesses }; } catch (error) { return error; } };
  • Tool schema definition including method name, description from prompts, Zod parameters schema reference (params.listBusinessesParameters), and required actions (read/list on businesses). This configures the tool for MCP usage.
    method: "list_businesses", name: "List businesses for a customer", description: prompts.listBusinessesPrompt, parameters: params.listBusinessesParameters, actions: { businesses: { read: true, list: true, }, }, },
  • src/api.ts:37-37 (registration)
    Registers the 'list_businesses' tool by mapping the constant TOOL_METHODS.LIST_BUSINESSES to the handler function funcs.listBusinesses in the toolMap used by PaddleAPI.run().
    [TOOL_METHODS.LIST_BUSINESSES]: funcs.listBusinesses,
  • src/constants.ts:29-29 (registration)
    Defines the constant TOOL_METHODS.LIST_BUSINESSES = 'list_businesses' used for tool identification in registrations and mappings.
    LIST_BUSINESSES: "list_businesses",
  • Helper function to extract pagination metadata (hasMore, estimatedTotal) from Paddle's PaginatedCollection, used by the list_businesses handler and other list functions.
    const paginationData = (collection: PaginatedCollection) => ({ hasMore: collection.hasMore, estimatedTotal: collection.estimatedTotal, });

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