Skip to main content
Glama
cleaninstall-node

cleaninstall-node

Apply the planned fix

apply_fix
Destructive

Executes an approved plan_id from diagnose/explain_error to repair broken Node.js/Deno installs via targeted rebuild, install, or clean reinstall; refuses changed plans and leaves lockfiles untouched.

Instructions

Run the fix plan from diagnose or explain_error: a targeted rebuild, an install, or (only when node_modules came from a different package manager) a clean reinstall. Requires that call's plan_id; refuses if the plan changed. Pass the same error text if the plan came from explain_error. Returns the command output and a re-check. Never touches lockfiles.

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": {
      "plan_id": "<plan_id>"
    },
    "name": "apply_fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirNoProject root containing package.json. Defaults to the server's working directory.
errorNoThe error text, if the plan came from explain_error.
nativeNoMust match the diagnose call (default true for diagnose, false for explain_error).
plan_idYesplan_id from diagnose or explain_error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the refusal condition ('refuses if the plan changed'), a safety boundary ('never touches lockfiles'), the required provenance of plan_id, and what is returned (command output plus a re-check). These are exactly the operational facts an agent needs before triggering a destructive, non-idempotent tool.

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

Conciseness5/5

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

Five short clauses, each carrying a distinct fact (allowed operations, prerequisite, refusal semantics, argument rule, return value, safety boundary). The riskiest operation is parenthetically qualified inline rather than buried, and there is no filler.

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?

With no output schema, the description compensates by summarizing the return ('command output and a re-check'), and it covers preconditions and side-effect limits for a destructive tool. It does not address reversibility of a partial install/rebuild or permission requirements, which are the remaining gaps.

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 coverage is already 100%, so the baseline is 3, but the description adds real meaning: plan_id must be the one from a prior diagnose or explain_error call, and the error text must be re-passed when the plan originated from explain_error. The native parameter is left to the schema rather than explained in prose.

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 (run the fix plan) and enumerates the concrete operations it can perform: targeted rebuild, install, or clean reinstall. Explicitly names its upstream sources (diagnose, explain_error), which separates it from siblings like clean and plan_clean.

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?

Gives clear provenance requirements (the plan_id must come from diagnose or explain_error) and a conditional gate for the riskiest mode ('only when node_modules came from a different package manager'). It stops short of naming clean or plan_clean as alternatives when no plan exists, leaving that routing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools