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 parameter. Omit it to use the server process's current working directory. For predictable automation, prefer an absolute repo-root path. See MCP overview for the workspace-root contract.

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
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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.

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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.

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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.
workflow_pathstringnoPath to workflow YAML. 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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.
workflow_pathstringnoPath to workflow YAML. Default: .loom/workflow.yml.
mount_modestringnoDocker mount mode: bind_mount or ephemeral_volume. Default: ephemeral_volume.

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.

Output

FieldTypeDescription
statusstring"success" or "failed"
exit_codenumberProcess exit code
receipt_pathstringRepo-relative path to the run receipt
receipt_jsonobjectParsed receipt contents
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" }

// 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 (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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.
receipt_pathstringyesPath to the receipt file within the workspace root (from loom_run_local or loom_validate output).

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_rootstringnoOverride the workspace root. Omit to use the server process current working directory.
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. Omit to auto-infer the failing step path.
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.