Skip to main content
Glama

Get workflow execution status

workflow_status
Read-onlyIdempotent

Retrieve the current status and result of a workflow execution, polling until completion if needed.

Instructions

Get the current state and result of a workflow execution.

Statuses: RUNNING | COMPLETED | FAILED | CANCELED | TERMINATED | CONTINUED_AS_NEW | TIMED_OUT | RETRYING_AFTER_ERROR

Poll until status is COMPLETED (or terminal) when waitForResult was false. result is populated once the workflow reaches a terminal state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
executionIdYesExecution ID from workflow_execute.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_nameYes
execution_idYes
root_execution_idYes
statusYes
resultNo
start_timeYes
end_timeYes
total_duration_msNo

Implementation Reference

  • The async handler function for the workflow_status tool. Calls mistral.workflows.executions.getWorkflowExecution with the executionId, then returns a structured response with workflow_name, execution_id, status, result, and timing info.
    async (input) => {
      try {
        const res = await mistral.workflows.executions.getWorkflowExecution({
          executionId: input.executionId,
        });
    
        const structured = {
          workflow_name: res.workflowName,
          execution_id: res.executionId,
          root_execution_id: res.rootExecutionId,
          status: res.status,
          result: res.result,
          start_time: res.startTime instanceof Date
            ? res.startTime.toISOString()
            : String(res.startTime),
          end_time: res.endTime instanceof Date
            ? res.endTime.toISOString()
            : res.endTime
              ? String(res.endTime)
              : null,
          total_duration_ms: res.totalDurationMs ?? null,
        };
    
        return {
          content: [toTextBlock(`${res.workflowName} [${res.executionId}] — ${res.status ?? "UNKNOWN"}.`)],
          structuredContent: structured,
        };
      } catch (err) {
        return errorResult("workflow_status", err);
      }
    }
  • WorkflowStatusOutputShape and WorkflowStatusOutputSchema defining the output fields: workflow_name, execution_id, root_execution_id, status, result, start_time, end_time, total_duration_ms.
    export const WorkflowStatusOutputShape = {
      workflow_name: z.string(),
      execution_id: z.string(),
      root_execution_id: z.string(),
      status: z.string().nullable(),
      result: z.unknown().nullable(),
      start_time: z.string(),
      end_time: z.string().nullable(),
      total_duration_ms: z.number().nullable().optional(),
    };
    export const WorkflowStatusOutputSchema = z.object(WorkflowStatusOutputShape);
  • Registration of the 'workflow_status' tool via server.registerTool with title, description, inputSchema (executionId), outputSchema (WorkflowStatusOutputShape), annotations, and the async handler.
    // ========== workflow_status ==========
    server.registerTool(
      "workflow_status",
      {
        title: "Get workflow execution status",
        description: [
          "Get the current state and result of a workflow execution.",
          "",
          "Statuses: RUNNING | COMPLETED | FAILED | CANCELED | TERMINATED |",
          "          CONTINUED_AS_NEW | TIMED_OUT | RETRYING_AFTER_ERROR",
          "",
          "Poll until status is COMPLETED (or terminal) when waitForResult was false.",
          "`result` is populated once the workflow reaches a terminal state.",
        ].join("\n"),
        inputSchema: {
          executionId: z.string().min(1).describe("Execution ID from workflow_execute."),
        },
        outputSchema: WorkflowStatusOutputShape,
        annotations: {
          title: "Workflow execution status",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async (input) => {
        try {
          const res = await mistral.workflows.executions.getWorkflowExecution({
            executionId: input.executionId,
          });
    
          const structured = {
            workflow_name: res.workflowName,
            execution_id: res.executionId,
            root_execution_id: res.rootExecutionId,
            status: res.status,
            result: res.result,
            start_time: res.startTime instanceof Date
              ? res.startTime.toISOString()
              : String(res.startTime),
            end_time: res.endTime instanceof Date
              ? res.endTime.toISOString()
              : res.endTime
                ? String(res.endTime)
                : null,
            total_duration_ms: res.totalDurationMs ?? null,
          };
    
          return {
            content: [toTextBlock(`${res.workflowName} [${res.executionId}] — ${res.status ?? "UNKNOWN"}.`)],
            structuredContent: structured,
          };
        } catch (err) {
          return errorResult("workflow_status", err);
        }
      }
    );
  • src/index.ts:59-83 (registration)
    The registerWorkflowTools function is called in index.ts to register all workflow tools (including workflow_status) on the MCP server.
    const server = new McpServer({
      name: "mistral-mcp",
      version: "0.7.1",
    });
    
    registerMistralTools(server, mistral, profile);
    registerFunctionTools(server, mistral, profile);
    
    if (profile !== "workflows") {
      // core, admin and metier-docs all get vision/OCR tools
      registerVisionTools(server, mistral);
    }
    
    registerAudioTools(server, mistral, profile);
    
    if (profile === "admin") {
      registerAgentTools(server, mistral);
      registerFileTools(server, mistral);
      registerBatchTools(server, mistral);
      registerSamplingTools(server);
    }
    
    // workflow tools are present in every profile
    registerWorkflowTools(server, mistral);
  • Helper functions toTextBlock and errorResult used by the workflow_status handler for formatting response content and error results.
    export function toTextBlock(payload: unknown) {
      return {
        type: "text" as const,
        text: typeof payload === "string" ? payload : JSON.stringify(payload),
      };
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnly, non-destructive, idempotent. Description adds that result is populated once terminal, and lists possible statuses, adding value beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise paragraphs: first states purpose, second lists statuses and gives polling guidance. No wasted words, front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple status-check tool with one param and an output schema, the description is complete: covers purpose, statuses, polling pattern, and result availability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter with schema description already stating 'Execution ID from workflow_execute.' Description adds no further semantic detail beyond the schema, which covers 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it gets the current state and result of a workflow execution, lists statuses for precision, and distinguishes from sibling tools like workflow_execute and workflow_interact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit polling guidance when waitForResult was false, and implies usage after execution. Does not explicitly state when not to use or alternatives, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/Swih/mistral-mcp'

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