Skip to main content

MCP tools reference

Loom MCP exposes 6 tools. Validation, compile, and run operations call shared Loom libraries in-process; the read tools operate on workspace artifacts. All tools return typed JSON.

All tools accept an optional workspace_root compatibility field. When present, it must exactly match the server's canonical startup directory. Requests cannot add roots or use relative or symlink aliases. Every content path is repo-relative and resolved beneath that root before open; rejected paths use WF_TRUSTED_PATH at the offending field. See MCP overview for startup and process-isolation guidance.

Quick reference

ToolPurposeKey inputs
loom_versionPrint CLI version
loom_validateValidate workflow schema
loom_compileCompile workflow to Graph IRworkflow_path
loom_run_localExecute workflow locallyworkflow_path, mount_mode, parallel
loom_read_receiptRead a run/validation receiptreceipt_path
loom_read_logsRead runtime logs by selectorrun_id, selector

loom_version

Print the Loom CLI version string. Use to verify the toolchain is available.

Equivalent Loom action: loom version

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.

Output

FieldTypeDescription
versionstringCLI version, e.g. loom v0.0.0-alpha.1

Example

// Request
{ "tool": "loom_version" }

// Response
{ "version": "loom v0.0.0-alpha.1" }

loom_validate

Validate the default workflow schema without executing it. Returns a receipt with validation results.

Equivalent Loom action: loom check

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.

Output

FieldTypeDescription
statusstring"success" or "failed"
exit_codenumberProcess exit code
receipt_pathstringRepo-relative path to the validation receipt
receipt_jsonobjectParsed receipt contents

Example

// Request
{ "tool": "loom_validate" }

// Response
{
"status": "success",
"exit_code": 0,
"receipt_path": ".loom/.runtime/receipts/loom-check-1772050684042246000.json",
"receipt_json": { "..." }
}

See Receipts contract for the receipt schema.


loom_compile

Compile the workflow into Graph IR JSON without executing it. Use to inspect the resolved dependency graph or feed downstream tooling.

Equivalent Loom action: loom compile

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.
workflow_pathstringnoRepo-relative workflow YAML path. Defaults to .loom/workflow.yml.

Output

FieldTypeDescription
graph_ir_jsonobjectThe compiled Graph IR
warningsobject[]Compiler warnings (each: code, path, message)
exit_codenumberProcess exit code

Example

// Request
{ "tool": "loom_compile" }

// Response
{
"graph_ir_json": { "..." },
"warnings": [],
"exit_code": 0
}

loom_run_local

Execute the workflow locally and produce runtime artifacts (logs, receipt). This is the primary "run the pipeline" tool.

Equivalent Loom action: loom run --local

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.
workflow_pathstringnoRepo-relative workflow YAML path. Default: .loom/workflow.yml.
mount_modestringnoDocker mount mode: bind_mount or ephemeral_volume. Default: ephemeral_volume.
parallelintegernoMaximum number of concurrently running jobs. Must be positive. Default: 1.

The mount_mode parameter controls how the workspace is mounted into Docker containers. ephemeral_volume (default) creates a Docker volume, seeds it with workspace contents, and removes the volume after execution (no full workspace sync-back). bind_mount directly mounts the host directory. See Docker provider for details.

The parallel parameter bounds runnable job execution. Dependencies and stage barriers still determine when each job can start. Explicit zero, negative, and non-integer values are rejected before the workflow starts.

Output

FieldTypeDescription
statusstringPublic run status: "success", "skipped", or "failed"
exit_codenumberPublic run exit code; a rule skip is 0 and a rule evaluation failure is 1
messagestringValue-safe workflow-rule outcome message when an explicit rule contract was evaluated
workflow_ruleobjectPublic rule outcome, stable reason, rule index, optional diagnostic code, and message
receipt_pathstringRepo-relative path to the run receipt
receipt_jsonobjectFiltered parsed receipt copy; rule expressions and raw rule errors are omitted
run_idstringRun identifier, e.g. loom-run-local-1772050684042246000
logs_dirstringRepo-relative path to the runtime logs directory
pipeline_summary_pathstringRepo-relative path to pipeline/summary.json when the run emitted pipeline artifacts
pipeline_manifest_pathstringRepo-relative path to pipeline/manifest.json when the run emitted pipeline artifacts
phase_report_pathstringRepo-relative path to phase-report.json when the run emitted a phase report
failing_job_idstringJob ID of the first failing job (only present on failure)
failing_job_manifest_pathstringRepo-relative path to the failing job manifest when available
artifact_pointersobject[]Array of artifact pointer objects for jobs that produced artifacts. Each pointer can include artifacts_archive_path when an archive was produced.

Example (success)

// Request
{ "tool": "loom_run_local", "parallel": 4 }

// Response
{
"status": "success",
"exit_code": 0,
"run_id": "loom-run-local-1772050684042246000",
"receipt_path": ".loom/.runtime/receipts/loom-run-local-1772050684042246000.json",
"receipt_json": { "..." },
"logs_dir": ".loom/.runtime/logs/loom-run-local-1772050684042246000"
}

Example (workflow-rule skip)

// Response
{
"status": "skipped",
"exit_code": 0,
"message": "workflow rules skipped execution: no rule matched",
"workflow_rule": {
"outcome": "skip",
"reason": "no_matching_rule",
"rule_index": -1,
"message": "workflow rules skipped execution: no rule matched"
},
"receipt_path": ".loom/.runtime/receipts/loom-run-local-1772050684042246000.json",
"receipt_json": { "..." }
}

The public skipped/0 fields are the MCP control-flow contract. The returned receipt_json is a filtered copy that omits rule expressions and replaces raw rule errors with the value-safe public message. The durable receipt at receipt_path remains unchanged and can retain its internal failure/1 envelope; see workflow rules.

Example (failure)

// Response
{
"status": "failed",
"exit_code": 1,
"run_id": "loom-run-local-1772050684042246000",
"receipt_path": ".loom/.runtime/receipts/loom-run-local-1772050684042246000.json",
"receipt_json": { "..." },
"logs_dir": ".loom/.runtime/logs/loom-run-local-1772050684042246000",
"failing_job_id": "check-pnpm"
}

On failure, use run_id and failing_job_id with loom_read_logs to triage. See the failure triage flow below.


loom_read_receipt

Read and parse a Loom receipt JSON file. Use to inspect structured metadata from a previous run or validation.

Equivalent Loom action: file read + JSON parse

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.
receipt_pathstringyesRepo-relative receipt JSON path beneath the startup root.

Output

FieldTypeDescription
receipt_jsonobjectParsed receipt contents
run_idstringRun identifier derived from receipt metadata when present
logs_dirstringRepo-relative path to the runtime logs directory when present
pipeline_summary_pathstringRepo-relative path to pipeline/summary.json when present
pipeline_manifest_pathstringRepo-relative path to pipeline/manifest.json when present
phase_report_pathstringRepo-relative path to phase-report.json when present
failing_job_idstringFailing job ID inferred from the pipeline manifest when available
failing_job_manifest_pathstringRepo-relative path to the failing job manifest when available
artifact_pointersobject[]Artifact pointer metadata from the pipeline manifest when available

Example

// Request
{
"tool": "loom_read_receipt",
"receipt_path": ".loom/.runtime/receipts/loom-run-local-1772050684042246000.json"
}

// Response
{
"receipt_json": { "..." }
}

See Receipts contract for what fields to expect.


loom_read_logs

Read Loom runtime logs by run ID and selector. This is the primary tool for failure triage — it navigates the structured log directory so you don't have to.

Equivalent Loom action: structured file reads over .loom/.runtime/logs/<run_id>/

Parameters

NameTypeRequiredDescription
workspace_rootstringnoOptional exact canonical startup directory; other values are rejected.
run_idstringyesRun identifier from loom_run_local output.
selectorstringyesWhat to read: pipeline_summary, pipeline_manifest, phase_report, job_summary, job_manifest, or events_jsonl.
job_idstringconditionalRequired for job_summary and job_manifest. For events_jsonl, omit to auto-infer from failure metadata.
events_pathstringnoFor events_jsonl only: repo-relative path beneath the selected run. Omit to infer it.
max_linesnumbernoMax lines to return. Default: 200, cap: 2000. Use 30 for focused triage.
tailbooleannoReturn the last max_lines events. Recommended for failure triage.
levelsstring[]noFilter by log level, e.g. ["error", "warn"].
streamsstring[]noFilter by stream, e.g. ["stderr"] for diagnostics.
containsstring[]noSubstring match over message/raw fields.

Selector reference

SelectorReadsUse when
pipeline_summaryPipeline-level status + exit codeFirst step: confirm overall pass/fail
pipeline_manifestPipeline pointer doc (job IDs, paths, artifact archive pointers)Identify which jobs ran, which failed, and where artifacts live
phase_reportPhase-level summary for the runInspect higher-level phase outcomes before drilling into a job
job_summaryJob-level status + exit codeDrill into a specific job
job_manifestJob pointer doc (step paths)Find the failing step within a job
events_jsonlStep-level event streamRead actual output, errors, diagnostics

Output

FieldTypeDescription
run_idstringEcho of the requested run ID
selectorstringEcho of the requested selector
job_idstringResolved job ID when applicable
resolved_pathstringRepo-relative path that was read after selector or events-path resolution
dataobjectParsed JSON for summary, manifest, and phase-report selectors
eventsobject[]Array of event objects for events_jsonl
line_countnumberNumber of lines or events returned
total_scannednumberTotal lines scanned before filtering
failing_job_idstringFailing job ID surfaced for pipeline_manifest when present
failing_job_manifest_pathstringRepo-relative failing job manifest path surfaced for pipeline_manifest when present
artifact_pointersobject[]Artifact pointer metadata surfaced for pipeline_manifest when present
artifactsobjectArtifacts metadata surfaced for job_manifest when present

Example: pipeline summary

{
"tool": "loom_read_logs",
"run_id": "loom-run-local-1772050684042246000",
"selector": "pipeline_summary"
}

Example: focused failure triage

{
"tool": "loom_read_logs",
"run_id": "loom-run-local-1772050684042246000",
"selector": "events_jsonl",
"tail": true,
"max_lines": 30,
"streams": ["stderr"]
}

This reads the failing step's events.jsonl, returns the last 30 stderr events, and auto-infers job_id and events_path from the run's failure metadata.

See Runtime logs contract for the full log directory structure and event schema.


Failure triage flow

When loom_run_local returns status: "failed", follow this sequence to identify the root cause with minimal reads.

Step 1 — Confirm overall status

{ "tool": "loom_read_logs", "run_id": "<run_id>", "selector": "pipeline_summary" }

Step 2 — Read the failing step's stderr

The server auto-infers the job and step from failure metadata:

{
"tool": "loom_read_logs",
"run_id": "<run_id>",
"selector": "events_jsonl",
"tail": true,
"max_lines": 30,
"streams": ["stderr"]
}

Step 3 — Widen if needed

If 30 lines of stderr aren't enough, increase the window or drop the stream filter:

{
"tool": "loom_read_logs",
"run_id": "<run_id>",
"selector": "events_jsonl",
"tail": true,
"max_lines": 200
}

Step 4 — Read the receipt for structured metadata

{ "tool": "loom_read_receipt", "receipt_path": "<receipt_path>" }

This follows the same methodology as the Diagnostics ladder but uses MCP tools instead of reading files directly.