feat(mcp-server): add getWorkflowRun tool (PRD-740) - #1785
Merged
christophebrun-forest merged 4 commits intoJul 29, 2026
Conversation
Expose the getWorkflowRun polling tool so the LLM can observe a run's status, closing the discover -> trigger -> poll loop. Report-only in v1: human-gated runs report waitingForHumanInput but cannot be resumed via MCP (tracked in PRD-441). Threads a getMcpWorkflowRun call through forestadmin-client (types, HTTP api, workflows service) to the MS7 read endpoint, and registers a read-only getWorkflowRun MCP tool scoped to the caller. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ools-in-forest-mcp-server' into feature/prd-740-mcp-ms8-getworkflowrun-tool
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Coverage Impact Unable to calculate total coverage change because base branch coverage was not found. Modified Files with Diff Coverage (6)
🛟 Help
|
christophebrun-forest
merged commit Jul 29, 2026
e87448d
into
feature/prd-49-expose-workflow-tools-in-forest-mcp-server
32 checks passed
christophebrun-forest
deleted the
feature/prd-740-mcp-ms8-getworkflowrun-tool
branch
July 29, 2026 15:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Story MS8 of PRD-49 · Iteration 4 (observation).
Exposes the
getWorkflowRunpolling tool so the LLM can observe a run's status, closing the discover (listWorkflows) → trigger (triggerWorkflow) → poll (getWorkflowRun) loop.Report-only in v1: a run parked on a human-gated step reports
waitingForHumanInput: truebut is not resumable via MCP — such runs are finished from the Forest UI (resume tracked in PRD-441).Changes
@forestadmin/forestadmin-clientWorkflowRunStep,WorkflowRunStatus,GetMcpWorkflowRunParams;getMcpWorkflowRunadded toWorkflowsServiceInterfaceandForestAdminServerInterfaceForestHttpApi.getMcpWorkflowRun()→GET /api/workflow-orchestrator/mcp-workflows/runs/:runId(rendering-id header, url-encoded runId)WorkflowsService.getMcpWorkflowRun()delegation + public exports@forestadmin/mcp-servergetWorkflowRuntool (readOnlyHint: true, zod argrunId: string; no activity log since read-only)getWorkflowRunon theForestServerClienthttp-clientserver.ts(ToolNameunion,allTools,allToolNames,SAFE_ARGUMENTS_FOR_LOGGING)Acceptance criteria
runState,currentStep,waitingForHumanInput, terminalresult/error, scoped to the callerwaitingForHumanInput: true, not resumable via MCP (v1)runId→ tool error 404/403Tests
forestadmin-client (299) + mcp-server (667) green; lint + build clean on both packages. Added coverage for the HTTP path/headers/url-encode, service delegation, http-client delegation, and the tool (registration, identity+args forwarding, human-gated reporting, missing auth, 404, 403).
Notes
fixes PRD-740
🤖 Generated with Claude Code
Note
Add
getWorkflowRunMCP tool to fetch workflow run statusgetWorkflowRuntool inpackages/mcp-server/src/tools/get-workflow-run.tsthat accepts arunId, extracts auth context, and returns the workflow run status as JSON.getMcpWorkflowRuntoWorkflowsServiceandForestHttpApi, performing a GET to/api/workflow-orchestrator/mcp-workflows/runs/{runId}with bearer token and rendering ID header.WorkflowsServiceInterface,ForestAdminServerInterface, andForestServerClientwith the new method signature, and exports the newWorkflowRunStatus,WorkflowRunStep, andGetMcpWorkflowRunParamstypes fromforestadmin-client.Macroscope summarized e02cf17.