Skip to main content
Glama

Auto-fix a workflow with AI

autofix_workflow
Like validate_workflow, but when issues remain it asks an AI model to
repair them (up to 2 rounds) and re-validates. Nothing is deployed.
Returns the repaired workflowJSON, ready to paste into n8n.

Args:
    workflow_json: The workflow JSON to repair.
    intent: What the workflow is meant to do -- helps fixes stay faithful.

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_json": "<workflow_json>"
    },
    "name": "autofix_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
intentNo
workflow_jsonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only say readOnly=false and destructive=false; the description adds real substance — AI-model invocation, a hard bound of 2 repair rounds, re-validation after fixing, and "nothing is deployed," which clarifies the mutation is local. It omits cost/latency implications of calling an AI model and what happens if repairs still fail after 2 rounds.

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?

Front-loaded with the key differentiator in the first sentence, and the return value is stated early. The Args block partially restates parameter names but earns its place given the 0% schema coverage.

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 two-parameter tool with a nested JSON object and no output schema, the description supplies purpose, bound on attempts, side-effect profile, and return shape ("repaired workflowJSON, ready to paste into n8n"). Missing only the failure/partial-repair outcome, which matters given the 2-round cap.

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 carries the burden and does explain both parameters: workflow_json is the JSON to repair, and intent is semantic context that keeps fixes faithful. It is a meaningful addition over a bare `object`/`string` schema, though it doesn't say intent is optional or what an empty intent yields.

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?

States a specific verb+resource ("asks an AI model to repair" a workflow) and anchors it to a named sibling ("Like validate_workflow, but..."). The distinguishing behavior — attempting repairs when validation issues remain — is unambiguous, so an agent can separate it from validate_workflow without opening either schema.

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?

Clear triggering condition: use it when validation leaves issues that need fixing, up to 2 rounds, with re-validation. It does not, however, distinguish itself from the confusingly similar sibling self_heal_workflow, nor state when to prefer plain validate_workflow and skip repair.

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.