coalesce-job-failure-investigation — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited coalesce-job-failure-investigation (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Diagnose why a Coalesce pipeline run failed, identify the root cause, inspect the failing SQL, and guide the user toward a fix.
Step 1: Find failed runs
↓
Step 2: Investigate the failure (root cause + downstream impact)
↓
Step 3: Inspect the failing node's SQL
↓
Step 4: Recommend a fix
↓
Step 5 (optional): Apply the fix if write access is available
↓
Step 6 (optional): Verify the fix by re-running the jobGoal: Identify which run(s) failed.
If the user provides a run ID: Skip to Step 2.
If the user asks about "the latest failure" or doesn't specify a run:
Call mcp__coalesce__list_failed_runs:
environment_id — pass if the user specifies an environment, otherwise omitlimit — default 20; use 1-5 if only looking for the most recentResponse shape:
{
"runs": [
{
"run_id": 7,
"run_status": "failed",
"environment_id": "22",
"job_name": "...",
"start_time": "2026-03-26T15:51:21.468Z",
"end_time": "2026-03-26T15:51:35.369Z",
"run_type": "refresh"
}
],
"next_cursor": null,
"count": 1
}Present the failed run(s) to the user with run ID, timestamp, and environment. If multiple failures exist, ask which one to investigate.
⚠️ STOP if multiple failures: Ask user which run to investigate before proceeding.
Goal: Get root cause, failing nodes, error messages, and downstream impact in one call.
Call mcp__coalesce__investigate_failure with the run_id.
This is the best single tool for failure diagnosis. It returns:
Response shape:
{
"run": {
"run_id": "7",
"run_status": "failed",
"environment_id": "22",
"run_type": "refresh",
"start_time": "...",
"end_time": "..."
},
"summary": {
"total_nodes": 3,
"failed": 1,
"succeeded": 1,
"downstream_blocked": 1
},
"failed_nodes": [
{
"node_id": "abc123",
"node_name": "STG_SENSOR_READINGS",
"error": "Numeric value '3W' is not recognized",
"sql": "INSERT INTO ..."
}
],
"downstream_blocked_nodes": [
{
"node_id": "def456",
"node_name": "DIM_SENSOR_READINGS",
"status": "skipped"
}
]
}Present to the user:
Ask for the workspace ID now — before proceeding to Step 3. The workspace ID is not included in run metadata and cannot be looked up programmatically. Tell the user:
"To inspect and fix the node I'll need your workspace ID. You can find it in the Coalesce URL when you're in the workspace: .../workspaces/{ID}/build/..."Store the workspace ID for use in Steps 3 and 5.
Goal: Get the full SQL and column transforms for the failing node so you can pinpoint the exact issue.
Deciding which tool to call:
environment_id from the investigate_failure response in Step 2 — use it directlymcp__coalesce__get_workspace_node with the workspace_id collected in Step 2 and the node_id from the failed nodelist_environment_nodes to try to find the node — you already have the node_id from investigate_failureWhat to look for in the response:
config.columns[].transform — the SQL transform expression per column (e.g., CAST(... AS FLOAT))overrideSQL — if true, look at the full custom SQL overridematerializationType — table, view, transient, etc.config.selectDistinct, config.whereClause, config.groupByAll — query modifiersCommon error patterns and fixes:
| Error Pattern | Likely Cause | Fix |
|---|---|---|
Numeric value 'X' is not recognized | Hard CAST on dirty data | Use TRY_CAST() instead of CAST() |
NULL result in a non-nullable column | Missing data with NOT NULL constraint | Add COALESCE() wrapper or relax constraint |
Object 'X' does not exist | Missing source table or schema drift | Check source exists; update reference |
Ambiguous column name | Join without table qualifier | Add table alias prefix |
Division by zero | Unguarded division | Add NULLIF(denominator, 0) |
Timestamp 'X' is not recognized | Date format mismatch | Use TRY_TO_TIMESTAMP() with format |
Present the problematic SQL/transform and recommend a specific fix.
Goal: Give the user a concrete, actionable fix.
Structure the recommendation as:
If the node uses column-level transforms (not overrideSQL), call out the specific column name and its transform expression.
Ask the user if they want you to apply the fix.
⚠️ STOP: Wait for user to confirm before attempting any writes.
Goal: Update the workspace node with the corrected SQL.
Prerequisites:
patch_node_field tool must be available (not hidden by COALESCE_READONLY_MODE=true)workspace_id from Step 2 — if somehow missing, the URL is .../workspaces/{ID}/build/...Workflow:
field_path to update based on your Step 3 inspection.Paths use the raw API node shape (not the slimmed display):
"metadata.columns[N].sources[0].transform" — find N by counting the column's position (0-based) in the get_workspace_node output"config.whereClause""config.preSQL" / "config.postSQL""metadata.storageMapping[N].join"Field: columns[2].transforms[0]
Before: CAST(raw_value AS FLOAT)
After: TRY_CAST(raw_value AS FLOAT)mcp__coalesce__patch_node_field with:workspace_idnode_idfield_path — the dot/bracket path identified in step 1new_value — the corrected SQL stringold_value and new_value confirming the change. Remind the user they may need to re-run the job to verify the fix.If `patch_node_field` is not available (read-only mode):
Tell the user to make the change manually in the Coalesce UI:
Goal: Re-run the job to confirm the fix resolves the failure.
Prerequisites:
retry_run tool must be available (not hidden by COALESCE_READONLY_MODE=true)⚠️ STOP: Ask the user if they want to re-run before triggering anything.
Workflow:
mcp__coalesce__retry_run with the original failed `run_id` from Step 1/2.start_run here unless the user explicitly wants a full refreshnew_run_id from the response.mcp__coalesce__get_run_status with new_run_id until runStatus is "complete" or "failed".mcp__coalesce__get_run_results with new_run_id to confirm results:failed: 0) → fix is confirmed, tell the userIf the retry itself fails to start:
retry_run is unavailable, suggest start_run with the same environment_id and job_id as a fallbackWhen: First step — find which runs failed. Params: environment_id (optional), limit (optional, default 20), starting_from (optional)
When: Need broader filtering (by status, environment) or want to see all runs. Params: environment_id, run_status (running|completed|failed|canceled), limit, starting_from
When: You have a run_id and want the full diagnosis in one call. Best starting point for failure investigation. Params: run_id (required)
When: You want pre-processed results (failed + blocked nodes) without run metadata. Use investigate_failure instead unless you specifically need just results. Params: run_id (required)
When: You want raw run metadata + extracted errors together. Less concise than investigate_failure. Params: run_id (required)
When: You need the run object only (no node results). Params: run_id (required)
When: Checking if a run is still in progress. Params: run_id (required)
When: Inspect the deployed (production) version of a node. Params: environment_id (required), node_id (required)
When: Inspect the development version of a node, or before updating it. Params: workspace_id (required), node_id (required)
When: Applying a full node replacement. Prefer patch_node_field for targeted single-field fixes. Params: workspace_id (required), node_id (required), node_config_json (required — full node object as JSON string)
When: Applying a targeted SQL fix to a single field. Preferred over set_node for failure remediation — handles fetch-modify-replace internally. Params: workspace_id (required), node_id (required), field_path (required — e.g. "columns[0].transforms[0]"), new_value (required) Returns: {success, node_name, field_path, old_value, new_value}
When: After applying a fix — re-runs only the previously failed nodes from a prior run. The primary tool for Step 6 verification. Params: run_id (required — the original failed run ID) Returns: {success, original_run_id, new_run_id} — use new_run_id to poll status
When: Triggering a fresh full-environment refresh (not a retry). Use this if the user wants to run the whole job from scratch rather than retry only failed nodes. Params: environment_id (required), job_id (optional), parallelism (optional) Returns: {success, run_id} — use run_id to poll status
When: Aborting a run that is taking too long, was triggered by mistake, or needs to be stopped before completion. Params: run_id (required), environment_id (optional) Returns: {success, run_id}
patch_node_fieldretry_run — do not trigger a run automatically| Problem | Solution |
|---|---|
investigate_failure returns no failed nodes | The run may have succeeded or been canceled. Check run_status field. Try get_run_results for raw data. |
| Node ID from failure isn't found in environment | The node may have been deleted or renamed since the run. Try list_environment_nodes to browse. |
set_node or patch_node_field tool not available | Environment is in read-only mode (COALESCE_READONLY_MODE=true). Guide user to make changes in the Coalesce UI. |
patch_node_field returns Invalid field_path | The path doesn't match the node structure. Call get_workspace_node to inspect the actual field names and array indices, then retry with the correct path. |
No workspace_id available | Ask the user at the end of Step 2, before proceeding. It's not included in run metadata. Tell them to find it in the Coalesce URL: .../workspaces/{ID}/build/... |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.