relay_run_get
Retrieve detailed execution data for a specific workflow run, including step outputs and trace information, to monitor and analyze AI orchestration processes.
Instructions
Get full details of a specific run including all step outputs and trace URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runId | Yes | The run ID to retrieve |
Implementation Reference
- src/tools/relay-run-get.ts:44-77 (handler)Core implementation of the 'relay_run_get' tool handler. Fetches run data by ID, formats timestamps and trace URL, handles missing runs.export async function relayRunGet( input: RelayRunGetInput ): Promise<RelayRunGetResponse> { const run = getRunById(input.runId); const config = getConfig(); if (!run) { return { found: false, error: `Run with ID "${input.runId}" not found. Note: Run history is stored in memory and clears on server restart.`, }; } return { found: true, run: { runId: run.runId, type: run.type, name: run.type === 'workflow' ? run.workflowName : undefined, model: run.type === 'single' ? run.model : undefined, success: run.success, startTime: run.startTime.toISOString(), endTime: run.endTime.toISOString(), durationMs: run.durationMs, usage: run.usage, input: run.input, output: run.output, steps: run.steps, error: run.error, traceUrl: `${config.traceUrlBase}/${run.runId}`, contextReduction: run.contextReduction, }, }; }
- src/tools/relay-run-get.ts:11-42 (schema)Input schema (Zod), input type, and response interface for the tool.export const relayRunGetSchema = z.object({ runId: z.string().describe('The run ID to retrieve'), }); export type RelayRunGetInput = z.infer<typeof relayRunGetSchema>; export interface RelayRunGetResponse { found: boolean; run?: { runId: string; type: 'single' | 'workflow'; name?: string; model?: string; success: boolean; startTime: string; endTime: string; durationMs: number; usage: { promptTokens: number; completionTokens: number; totalTokens: number; estimatedProviderCostUsd: number; }; input?: any; output?: any; steps?: Record<string, any>; error?: string; traceUrl: string; contextReduction?: string; }; error?: string; }
- src/tools/relay-run-get.ts:79-92 (schema)MCP tool definition including name, description, and JSON schema for input validation.export const relayRunGetDefinition = { name: 'relay_run_get', description: 'Get full details of a specific run including all step outputs and trace URL.', inputSchema: { type: 'object' as const, properties: { runId: { type: 'string', description: 'The run ID to retrieve', }, }, required: ['runId'], }, };
- src/server.ts:59-67 (registration)Registers the tool by including its definition in the TOOLS array returned by listTools MCP handler.const TOOLS = [ relayModelsListDefinition, relayRunDefinition, relayWorkflowRunDefinition, relayWorkflowValidateDefinition, relaySkillsListDefinition, relayRunsListDefinition, relayRunGetDefinition, ];
- src/server.ts:139-142 (handler)Server-side dispatch for the tool call: parses input with schema and invokes the handler function.case 'relay_run_get': { const parsed = relayRunGetSchema.parse(args); result = await relayRunGet(parsed); break;