relay_runs_list
List recent workflow runs for debugging and reference, enabling efficient AI workflow orchestration by chaining multi-step LLM operations.
Instructions
List recent workflow runs for debugging and reference.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of runs to return (default: 10, max: 50) |
Implementation Reference
- src/tools/relay-runs-list.ts:41-66 (handler)The core handler function for the 'relay_runs_list' tool. Fetches recent runs from the run store, computes summaries with metrics like duration, tokens, cost, and trace URLs, and returns the formatted list.export async function relayRunsList( input: RelayRunsListInput ): Promise<RelayRunsListResponse> { const limit = input.limit || 10; const runs = getRecentRuns(limit); const config = getConfig(); const summaries: RunSummary[] = runs.map((run: RunRecord) => ({ 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(), durationMs: run.durationMs, totalTokens: run.usage.totalTokens, estimatedCostUsd: run.usage.estimatedProviderCostUsd, traceUrl: `${config.traceUrlBase}/${run.runId}`, contextReduction: run.contextReduction, })); return { runs: summaries, total: summaries.length, }; }
- src/tools/relay-runs-list.ts:11-18 (schema)Zod schema defining the input parameters for the relay_runs_list tool, including an optional limit for the number of runs.export const relayRunsListSchema = z.object({ limit: z .number() .min(1) .max(50) .optional() .describe('Number of runs to return (default: 10, max: 50)'), });
- src/tools/relay-runs-list.ts:68-80 (registration)MCP tool definition object specifying the name, description, and input schema structure for registration.export const relayRunsListDefinition = { name: 'relay_runs_list', description: 'List recent workflow runs for debugging and reference.', inputSchema: { type: 'object' as const, properties: { limit: { type: 'number', description: 'Number of runs to return (default: 10, max: 50)', }, }, }, };
- src/server.ts:59-67 (registration)Array of all tool definitions, including relayRunsListDefinition, registered with the MCP server's listTools request handler.const TOOLS = [ relayModelsListDefinition, relayRunDefinition, relayWorkflowRunDefinition, relayWorkflowValidateDefinition, relaySkillsListDefinition, relayRunsListDefinition, relayRunGetDefinition, ];
- src/server.ts:134-137 (handler)Dispatch logic in the MCP callTool request handler: parses arguments with the tool schema and invokes the relayRunsList handler function.case 'relay_runs_list': { const parsed = relayRunsListSchema.parse(args || {}); result = await relayRunsList(parsed); break;