Skip to main content
Glama

getStatus

Retrieve workflow status by ID to monitor progress and manage content operations in Adobe Experience Manager.

Instructions

Get workflow status by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowIdYes

Implementation Reference

  • Core handler implementation for the getStatus tool. Fetches workflow status from AEM's /etc/workflow/instances/{workflowId}.json endpoint, processes status mapping, step parsing, progress calculation, and returns structured response.
    async getWorkflowStatus(workflowId: string): Promise<WorkflowStatusResponse> { return safeExecute<WorkflowStatusResponse>(async () => { if (!workflowId) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, 'Workflow ID is required', { workflowId } ); } try { // Get workflow instance details const response = await this.httpClient.get(`/etc/workflow/instances/${workflowId}.json`); const workflowData = response.data; // Parse workflow status and steps const status = this.mapWorkflowStatus(workflowData.state); const steps = this.parseWorkflowSteps(workflowData.history || []); const currentStep = this.getCurrentStep(steps); const progress = this.calculateProgress(steps); return createSuccessResponse({ workflowId, status, currentStep, progress, startedBy: workflowData.startedBy || 'admin', startedAt: workflowData.startedAt || new Date().toISOString(), completedAt: status === 'COMPLETED' ? workflowData.completedAt : undefined, steps }, 'getWorkflowStatus') as WorkflowStatusResponse; } catch (error: any) { if (error.response?.status === 404) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Workflow not found: ${workflowId}`, { workflowId } ); } throw handleAEMHttpError(error, 'getWorkflowStatus'); } }, 'getWorkflowStatus'); }
  • MCP server dispatching handler for getStatus tool invocation within CallToolRequestSchema handler.
    case 'getStatus': { const result = await aemConnector.getWorkflowStatus(args.workflowId); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema definition for getStatus tool registration, requiring workflowId parameter.
    name: 'getStatus', description: 'Get workflow status by ID', inputSchema: { type: 'object', properties: { workflowId: { type: 'string' } }, required: ['workflowId'], }, },
  • TypeScript interface defining the output structure of the getStatus tool response.
    export interface WorkflowStatusResponse { success: boolean; operation: string; timestamp: string; data: { workflowId: string; status: 'RUNNING' | 'COMPLETED' | 'SUSPENDED' | 'ABORTED' | 'FAILED'; currentStep: string; progress: number; startedBy: string; startedAt: string; completedAt?: string; steps: Array<{ name: string; status: 'PENDING' | 'ACTIVE' | 'COMPLETED' | 'FAILED'; startedAt?: string; completedAt?: string; assignee?: string; comment?: string; }>; }; }
  • Registration of tool list handler that exposes getStatus among other tools via MCP ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

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/indrasishbanerjee/aem-mcp-server'

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