Skip to main content
Glama

Test and self-heal a workflow

self_heal_workflow
Runs the workflow for real on your n8n, reads back the actual result,
and either proposes a fix for review (mode "suggest", the default) or
fixes and re-tests up to max_iterations times (mode "auto"). Running
can have real side effects (messages, emails) -- ask the user first.

Args:
    workflow_id: The deployed workflow's id.
    workflow_json: Its current JSON (starting point for fixes).
    original_prompt: What it is meant to do, if known.
    mode: "suggest" or "auto".
    max_iterations: Fix/re-test attempts (hard max 5).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "workflow_id": "<workflow_id>",
      "workflow_json": "<workflow_json>"
    },
    "name": "self_heal_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNosuggest
workflow_idYes
workflow_jsonYes
max_iterationsNo
original_promptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Adds substantial context beyond annotations: the tool actually executes the workflow with real side effects, requires user consent, defaults to a non-applying suggest mode, and hard-caps retries at 5. Annotations confirm it is a non-read-only, open-world operation, and the description does not contradict them. It stops short of saying what a failed auto-fix leaves behind or what the response contains.

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

Conciseness4/5

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

The behavioral sentence is front-loaded and sets expectations before the Args list. The Args enumeration duplicates schema field names, but with 0% schema description coverage that duplication is earning its place rather than wasting space.

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

Completeness4/5

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

For a mutating, open-world tool with no annotations covering side effects or output schema, the description supplies the critical pieces: real execution, consent requirement, mode semantics, and iteration ceiling. What a returned 'proposed fix' looks like is left implicit, which is the main remaining gap.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry the load, and its Args block does: workflow_id is the deployed id, workflow_json is the starting point for fixes, original_prompt is optional intent, mode is suggest|auto, and max_iterations is capped at 5. It does not restate the numeric default of 3 for max_iterations, a minor omission against a 0%-coverage schema.

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

Purpose4/5

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

States a specific multi-step verb chain: runs the workflow for real, reads back the actual result, then proposes or applies a fix. That is clearly distinct from pure static tools like validate_workflow or generate_workflow. It never names the closest sibling, autofix_workflow, so the boundary between them must be inferred.

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?

Explicitly gives the two modes with the default ('suggest', the default) and the precondition to ask the user first because of real side effects (messages, emails). Missing is an explicit 'use autofix_workflow instead when...' exclusion, which matters given a near-identical sibling.

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.