workflow_status
Retrieve current workflow progress and session state to track development phase completion within structured programming workflows.
Instructions
Check current workflow progress and session state
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/workflowStatus.ts:16-66 (handler)The main handler function that executes the workflow_status tool logic. It retrieves the current session from the SessionManager, checks for active session, formats phase outputs with timestamps/durations, and returns a comprehensive status object including sessionId, task, timing, current phase, completed phases, phase outputs, metrics (files analyzed/modified, lint issues), file operations, next step suggestions, and a reminder about session data being temporary.
export async function handleWorkflowStatus(sessionManager: SessionManager) { const session = sessionManager.getSession(); if (!session) { return { status: 'No active session', message: 'Start a new workflow with plan_workflow tool', hint: 'Example: plan_workflow({ task: "Refactor authentication system" })' }; } const phaseOutputs: Record<string, any> = {}; session.phaseOutputs.forEach((output, phase) => { phaseOutputs[phase] = { completedAt: new Date(output.completedAt).toISOString(), duration: formatDuration(output.duration), output: output.output }; }); const timeElapsed = Date.now() - session.startedAt; return { sessionId: session.id, task: session.taskDescription, startedAt: new Date(session.startedAt).toISOString(), timeElapsed: formatDuration(timeElapsed), currentPhase: session.currentPhase, completedPhases: session.completedPhases, phaseOutputs, metrics: { filesAnalyzed: session.metrics.filesAnalyzed, filesModified: session.metrics.filesModified, lintIssuesFound: session.metrics.lintIssuesFound, lintIssuesFixed: session.metrics.lintIssuesFixed, phasesCompleted: session.completedPhases.length, totalPhases: 9 // Total phases in the workflow }, fileOperations: { totalFilesTracked: session.fileHistory.size, filesRead: Array.from(session.fileHistory.entries()) .filter(([_, history]) => history.hasBeenRead) .map(([file, _]) => file), filesModified: Array.from(session.fileHistory.entries()) .filter(([_, history]) => history.hasBeenModified) .map(([file, _]) => file) }, nextSteps: generateNextStepSuggestions(session.completedPhases, session.currentPhase), reminder: 'This session data is temporary and will be lost when the MCP connection ends' }; } - src/tools/workflowStatus.ts:5-14 (schema)The tool schema/definition created by createWorkflowStatusTool(). Defines the tool name 'workflow_status', description 'Check current workflow progress and session state', and an empty input schema (no parameters required).
export function createWorkflowStatusTool(): Tool { return { name: 'workflow_status', description: 'Check current workflow progress and session state', inputSchema: { type: 'object', properties: {} } }; } - src/index.ts:19-19 (registration)Import of createWorkflowStatusTool and handleWorkflowStatus from the workflowStatus module.
import { createWorkflowStatusTool, handleWorkflowStatus } from './tools/workflowStatus.js'; - src/index.ts:154-154 (registration)Registration of the workflow_status tool in the tools array via createWorkflowStatusTool().
createWorkflowStatusTool(), // Workflow status - src/index.ts:266-272 (registration)The switch-case handler in the CallToolRequestSchema that routes the 'workflow_status' tool name to the handleWorkflowStatus function.
case 'workflow_status': return { content: [{ type: 'text', text: JSON.stringify(await handleWorkflowStatus(sessionManager), null, 2) }] };