get_simulation_run
Retrieve a simulation run from Paddle by its ID, optionally including related events to analyze the simulation's outcomes.
Instructions
This tool will retrieve a simulation run from Paddle by its ID.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| simulationId | Yes | Paddle ID of the simulation entity associated with the run. | |
| simulationRunId | Yes | Paddle ID of the simulation run entity. | |
| include | Yes | Include related entities in the response. |
Implementation Reference
- src/functions.ts:640-656 (handler)The core handler function that implements the get_simulation_run tool by calling the Paddle SDK's simulationRuns.get method with the provided simulationId, simulationRunId, and optional query parameters.export const getSimulationRun = async ( paddle: Paddle, params: z.infer<typeof Parameters.getSimulationRunParameters>, ) => { try { const { simulationId, simulationRunId, ...queryParams } = params; const hasQueryParams = Object.keys(queryParams).length > 0; const simulationRun = await paddle.simulationRuns.get( simulationId, simulationRunId, hasQueryParams ? queryParams : undefined, ); return simulationRun; } catch (error) { return error; } };
- src/tools.ts:878-888 (schema)Defines the MCP tool schema including the Zod parameters schema (params.getSimulationRunParameters), description prompt, name, and required permissions/actions for the get_simulation_run tool.method: "get_simulation_run", name: "Get a run for a simulation", description: prompts.getSimulationRunPrompt, parameters: params.getSimulationRunParameters, actions: { simulationRuns: { read: true, get: true, }, }, },
- src/api.ts:61-61 (registration)Registers the getSimulationRun handler in the toolMap object, mapping the constant TOOL_METHODS.GET_SIMULATION_RUN to the function for execution in PaddleAPI.run.[TOOL_METHODS.GET_SIMULATION_RUN]: funcs.getSimulationRun,
- src/constants.ts:53-53 (registration)Defines the constant TOOL_METHODS.GET_SIMULATION_RUN used for tool identification in registration and tool definitions.GET_SIMULATION_RUN: "get_simulation_run",
- src/toolkit.ts:70-85 (helper)The dynamic registration loop in PaddleMCPServer that registers all filtered tools (including get_simulation_run) with the MCP server using the tool definitions from tools.ts and delegates execution to PaddleAPI.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), }, ], }; }, );