get_run
Retrieve the current summary status of a known orchestration run to monitor task progress and manage subagent execution across coding backends.
Instructions
Get the current summary status for a known run.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes |
Implementation Reference
- src/core/run-manager.ts:138-149 (handler)The main handler method that executes the get_run tool logic. It first checks for an active run in memory, then falls back to reading from storage. Returns the run status and metadata.
async getRun(input: GetRunInput): Promise<GetRunResult> { const managed = this.findManagedRun(input.run_id); if (managed) { return toGetRunResult(managed.record); } const record = await this.storage.readRunRecordById(input.run_id); if (!record) { throw new Error(`Unknown run_id: ${input.run_id}`); } return toGetRunResult(record); } - src/core/schemas.ts:129-131 (schema)Input schema definition for the get_run tool. Validates that run_id is a non-empty string.
export const getRunSchema = z.object({ run_id: z.string().min(1), }); - src/tools/get-run.ts:6-23 (registration)Registration function that registers the get_run tool with the MCP server. Connects the tool name, schema, and handler together.
export function registerGetRunTool(server: McpServer, manager: RunManager): void { server.registerTool( 'get_run', { description: 'Get the current summary status for a known run.', inputSchema: getRunSchema, outputSchema: runSummarySchema, }, async (args) => { try { const result = await manager.getRun(args); return asToolResult(result); } catch (error) { return asToolError(String(error)); } }, ); } - src/core/types.ts:173-190 (schema)TypeScript type definitions for the get_run tool input and output structures.
export interface GetRunInput { run_id: string; } export interface GetRunResult { run_id: string; backend: BackendKind; role: RunRole; session_id: string; status: RunStatus; started_at: string; updated_at: string; summary: string; last_seq: number; cwd: string; metadata: Record<string, unknown>; remote_ref: RemoteRef | null; } - src/core/run-manager.ts:541-556 (helper)Helper function that transforms a RunRecord into a GetRunResult, mapping internal property names to the external API format.
function toGetRunResult(record: RunRecord): GetRunResult { return { run_id: record.runId, backend: record.backend, role: record.role, session_id: record.sessionId, status: record.status, started_at: record.startedAt, updated_at: record.updatedAt, summary: record.summary, last_seq: record.lastSeq, cwd: record.cwd, metadata: record.metadata, remote_ref: record.remoteRef, }; }