list_simulation_runs
Retrieve and manage simulation runs in Paddle Billing with pagination, filtering, and event inclusion for comprehensive analysis.
Instructions
This tool will list simulation runs in Paddle.
Use the maximum perPage by default (200) to ensure comprehensive results. Filter simulationRuns by id 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.
Use the include parameter to include related entities in the response:
events: An array of events entities for events sent by this simulation run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| simulationId | Yes | Paddle ID of the simulation to list runs for. | |
| after | No | Return entities after the specified Paddle ID when working with paginated endpoints. | |
| include | No | Include related entities in the response. | |
| 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. | |
| id | No | Return only the IDs specified. Use a comma-separated list to get multiple entities. |
Implementation Reference
- src/functions.ts:612-625 (handler)The main execution handler for the 'list_simulation_runs' tool. It destructures simulationId and queryParams from input, lists simulation runs using the Paddle SDK's simulationRuns.list method, fetches the first page with next(), computes pagination data, and returns the results with pagination info. Handles errors by returning the error object.export const listSimulationRuns = async ( paddle: Paddle, params: z.infer<typeof Parameters.listSimulationRunsParameters>, ) => { try { const { simulationId, ...queryParams } = params; const collection = paddle.simulationRuns.list(simulationId, queryParams); const simulationRuns = await collection.next(); const pagination = paginationData(collection); return { pagination, simulationRuns }; } catch (error) { return error; } };
- src/tools.ts:854-863 (schema)Defines the tool schema for 'list_simulation_runs' including the method name, human-readable name, description prompt, Zod parameters schema (imported as params.listSimulationRunsParameters), and required actions (read/list on simulationRuns). This is used for tool registration and validation.method: "list_simulation_runs", name: "List runs for a simulation", description: prompts.listSimulationRunsPrompt, parameters: params.listSimulationRunsParameters, actions: { simulationRuns: { read: true, list: true, }, },
- src/api.ts:59-59 (registration)Registers the 'list_simulation_runs' tool by mapping TOOL_METHODS.LIST_SIMULATION_RUNS to the handler funcs.listSimulationRuns in the toolMap object, which is used by PaddleAPI.run() to dispatch tool calls to the correct handler.[TOOL_METHODS.LIST_SIMULATION_RUNS]: funcs.listSimulationRuns,
- src/constants.ts:51-51 (registration)Defines the constant TOOL_METHODS.LIST_SIMULATION_RUNS as 'list_simulation_runs', used across the codebase for consistent tool method naming in registrations and references.LIST_SIMULATION_RUNS: "list_simulation_runs",
- src/prompts.ts:984-995 (helper)Provides the descriptive prompt for the 'list_simulation_runs' tool, explaining usage, parameters like perPage/after/orderBy/include, and response structure. Used in tool schema for LLM guidance.export const listSimulationRunsPrompt = ` This tool will list simulation runs in Paddle. Use the maximum perPage by default (200) to ensure comprehensive results. Filter simulationRuns by id 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. Use the include parameter to include related entities in the response: - events: An array of events entities for events sent by this simulation run. `;