Skip to main content
Glama

Extend MCP

Run a workflow on a document

run_workflow

Start a run of a deployed multi-step workflow on a document (workflows group; not runnable until a version is deployed, or pass version "draft"). Workflow runs commonly take minutes to hours. Async: a status: "running" result with a runId is not an error — resume with get_workflow_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Statuses: PROCESSED; FAILED (retryable: true means the failureReason is usually transient and one retry is reasonable); NEEDS_REVIEW (paused for a human reviewer in the dashboard — share dashboardUrl with the user and re-check the run after they finish; do not retry or re-submit); REJECTED (a reviewer rejected the run in the dashboard — final; dashboardUrl has their reasoning); CANCELLED. For one merged run over 2-50 related files, pass package instead of file. outputs injects pre-computed results for specific extractors/classifiers/splitters so the workflow skips recomputing them (not allowed with package).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoInput document. Mutually exclusive with package. Exactly one of id/url/text — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
detailNo"concise" (default): status, output, failure fields, dashboardUrl. "full": adds config, confidence/citations, usage, timestamps.
outputsNoPre-computed results the workflow should use instead of recomputing those steps. Not allowed with package.
packageNo2-50 files (id/url only) processed together as one merged run. Mutually exclusive with file and with outputs.
secretsNoSecrets passed to external-data-validation steps.
metadataNoArbitrary key-value metadata stored on the run.
priorityNoQueue priority (1-100).
workflowYesThe workflow to run.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
runIdYes
statusYesPROCESSED | FAILED | NEEDS_REVIEW | REJECTED | CANCELLED, or "running" (resume via the get tool).
outputsNoPer-step output values from completed steps.
runTypeNo
retryableNoPresent on FAILED runs: true when the failureReason is usually transient and one retry is reasonable.
stepSummaryNo
dashboardUrlNo
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / retryable
      Added value: +{
      +  "description": "Present on FAILED runs: true when the failureReason is usually transient and one retry is reasonable.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations only provide readOnlyHint: false, openWorldHint: true, idempotentHint: false, destructiveHint: false. The description carries the full behavioral burden and does so thoroughly: explains that runs are async, can take minutes to hours, that a 'running' status is not an error, and how to poll for terminal status. It also discloses that retrying is only appropriate for retryable failures, and that NEEDS_REVIEW/REJECTED require human interaction. No contradiction with 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?

The description is long but every sentence earns its place. It front-loads the core purpose and async/status behavior before diving into parameters. Statuses are enumerated clearly, and constraints (e.g., outputs not allowed with package) are highlighted. The structure is logical: purpose, async handling, statuses, then parameter-specific notes. No redundant or filler content.

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?

Given the tool's complexity (11 params, nested objects, async execution, output schema), the description covers all essential aspects: how to invoke, how to handle async results, what each status means, error recovery steps, and the distinction between file/package/outputs. It also references get_me for granted targets and get_workflow_run for polling. Nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

Despite 100% schema description coverage, the description adds substantial meaning beyond the schema. It explains the mutual exclusivity of file and package, the requirement of exactly one of id/url/text, the meaning of the 'detail' enum values, the shape of pre-computed outputs, the default for workflow.version, and the environment/target constraints from get_me. This goes far beyond the schema's property descriptions.

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?

The description starts with a clear verb+resource: 'Start a run of a deployed multi-step workflow on a document.' It immediately distinguishes this from sibling run tools (e.g., run_workflow_batch) by specifying it's for a single document (or package) and mentions the 'workflows group' context. It also clarifies prerequisites (deployment or draft version), making the tool's purpose unambiguous.

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

Usage Guidelines5/5

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

Provides explicit when-to-use and when-not-to-use guidance: states package is for 2-50 files instead of file, and outputs are not allowed with package. It explains async behavior and tells the agent to resume with get_workflow_run, never re-submitting. It also gives specific handling for statuses (retryable, NEEDS_REVIEW, REJECTED) and error cases (UNAUTHORIZED/NOT_FOUND → call get_me). This is comprehensive and actionable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources