list_reports
Retrieve and filter financial reports from Paddle Billing with pagination, sorting, and status-based filtering capabilities.
Instructions
This tool will list reports in Paddle.
Use the maximum perPage by default (200) to ensure comprehensive results. Filter reports by 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.
Amounts are in the smallest currency unit (e.g., cents).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Return entities after the specified Paddle ID when working with paginated endpoints. | |
| orderBy | No | Order returned entities by the specified field and direction. | |
| perPage | No | Set how many entities are returned per page. Returns the maximum number of results if a number greater than the maximum is requested. | |
| status | No | Return entities that match the specified status. Use a comma-separated list to specify multiple status values. |
Implementation Reference
- src/functions.ts:941-951 (handler)The handler function implementing the list_reports tool logic. It lists reports using the Paddle SDK's reports.list method, fetches the first page of results, computes pagination data, and returns paginated reports or an error.export const listReports = async (paddle: Paddle, params: z.infer<typeof Parameters.listReportsParameters>) => { try { const collection = paddle.reports.list(params); const reports = await collection.next(); const pagination = paginationData(collection); return { pagination, reports }; } catch (error) { return error; } };
- src/tools.ts:926-936 (schema)The schema definition for the list_reports tool, including the method name, human-readable name, description prompt, Zod parameters schema reference, and required permissions/actions for reports listing.method: "list_reports", name: "List reports", description: prompts.listReportsPrompt, parameters: params.listReportsParameters, actions: { reports: { read: true, list: true, }, }, },
- src/api.ts:85-85 (registration)Registration of the listReports handler function in the internal toolMap used by PaddleAPI.run method to dispatch tool calls.[TOOL_METHODS.LIST_REPORTS]: funcs.listReports,
- src/toolkit.ts:70-936 (registration)Dynamic registration of all tools including list_reports in the MCP server (PaddleMCPServer), using the schema from tools.ts and delegating execution to PaddleAPI.run.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), }, ], }; }, ); registeredCount++; }); if (registeredCount === 0) { throw new Error( "No tools were registered with the current filter settings. " + "The value of the --tools parameter must be 'all', 'read-only', 'non-destructive', or a comma-separated list of valid tools." ); } } } export default PaddleMCPServer;
- src/constants.ts:77-77 (helper)Constant definition for the LIST_REPORTS tool method string used in registrations and mappings.LIST_REPORTS: "list_reports",