Skip to main content
Glama

Generate a dead-code removal patch

generate_fix
Destructive

Build a unified-diff patch that removes or comments out dead code found by static analysis, after grep verification. Preview changes by default or apply them when validation succeeds.

Instructions

Build a unified-diff patch that removes (or comments out) dead code found by static analysis, after grep verification drops findings that are still referenced.

Returns the diff, patch summary, validation errors and applied status. With apply=False (default) it previews changes; with apply=True it edits files if patch validation succeeds. Refuses to run when the analysis or grep verification was incomplete. Review the diff and run trusted tests before keeping it.

Requires SKYLOS_API_KEY: this tool returns an authentication error unless the MCP server is started with SKYLOS_API_KEY set. Without a key only analyze works (5 calls/day). The local CLI needs no key: skylos verify <file> and skylos agent install-hooks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo"delete" removes dead code; "comment" comments it out instead.delete
pathYesDirectory or file to scan. A relative path resolves against the MCP server's working directory.
applyNoFalse (default) previews the unified diff. True also writes changes when patch validation succeeds.
min_safetyNoSkip findings whose safety score (0.0-1.0; imports score highest, methods lowest) is below this value.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.49.0
    • addedInput schema / properties / apply / description
      Added value: +"False (default) previews the unified diff. True also writes changes when patch validation succeeds."
    • addedInput schema / properties / min_safety / description
      Added value: +"Skip findings whose safety score (0.0-1.0; imports score highest, methods lowest) is below this value."
    • addedInput schema / properties / mode / description
      Added value: +"\"delete\" removes dead code; \"comment\" comments it out instead."
    • addedInput schema / properties / path / description
      Added value: +"Directory or file to scan. A relative path resolves against the MCP server's working directory."
  2. Addedv4.10.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already mark it as destructive and non-read-only, but the description adds substantial context beyond them: refusal conditions, patch-validation gating, the 5 calls/day unauthenticated limit, the exact auth error behavior, and an explicit advisory to review the diff and run trusted tests. This is unusually rich behavioral disclosure for a mutation tool.

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-loads the core action, then layers return values, apply semantics, and prerequisites in short paragraphs. Every sentence carries information, though the return-value sentence is partially redundant given an output schema exists.

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

Completeness5/5

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

Covers what the tool does, its preconditions, its auth model, its destructive path, and its safety advisory. With an output schema present it does not need to detail return values, and nothing an agent needs to invoke it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so mode, path, apply, and min_safety are already documented at the parameter level. The description restates the apply default and preview/write distinction but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 and artifact: 'Build a unified-diff patch that removes (or comments out) dead code found by static analysis,' and clarifies the pre-filtering by grep verification. This distinguishes it from siblings like verify_dead_code (detection) and analyze (analysis), so an agent can tell which tool actually produces a patch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly explains the apply=False preview vs apply=True write path, the precondition (refuses when analysis or grep verification was incomplete), and the auth requirement that gates it. It also routes the agent: without SKYLOS_API_KEY only `analyze` works, and it names the no-key local CLI alternatives (`skylos verify`, `skylos agent install-hooks`).

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