Skip to main content
Glama

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
NameRequiredDescriptionDefault
run_idYes

Implementation Reference

  • 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);
    }
  • 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),
    });
  • 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));
          }
        },
      );
    }
  • 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;
    }
  • 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,
      };
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dufangshi/orchestration-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server