Skip to main content
Glama

Verify dead code with an LLM

verify_dead_code
Read-only

Verify suspected dead code findings with an LLM to cut false positives before deleting unused functions, classes, imports, or variables after a static analysis scan.

Instructions

Ask an LLM to review selected unused function, class, import and variable candidates, with its reasoning.

Use it after analyze when you need fewer false positives before deleting code. Sends code snippets and search results to the chosen model provider, so it needs the skylos[llm] extra and provider configuration, including credentials when required. Candidates outside the review limits, or whose use remains uncertain, can remain unverified. Does not edit files. Refuses to run when the static analysis was incomplete.

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

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": {
      "path": "<path>"
    },
    "name": "verify_dead_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesDirectory or file to scan. A relative path resolves against the MCP server's working directory.
modelNoLLM model name passed to the provider (e.g. gpt-4.1 or a Claude model). Configure the provider's credentials in the MCP server's environment when required by that provider.gpt-4.1
confidenceNoMinimum confidence (0-100) for dead-code findings. Higher values report fewer, surer candidates; 60 is the CLI default.
max_verifyNoMaximum findings in the main LLM verification pass. Entry discovery, prefiltering and challenges can make additional model calls.
max_challengeNoMaximum number of surviving findings the model re-checks in a second pass.
exclude_foldersNoExtra folder names to skip, comma-separated (e.g. "migrations,scripts"). Added to the default excludes.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv4.49.0
    • addedInput schema / properties / confidence / description
      Added value: +"Minimum confidence (0-100) for dead-code findings. Higher values report fewer, surer candidates; 60 is the CLI default."
    • addedInput schema / properties / exclude_folders / description
      Added value: +"Extra folder names to skip, comma-separated (e.g. \"migrations,scripts\"). Added to the default excludes."
    • addedInput schema / properties / max_challenge / description
      Added value: +"Maximum number of surviving findings the model re-checks in a second pass."
    • addedInput schema / properties / max_verify / description
      Added value: +"Maximum findings in the main LLM verification pass. Entry discovery, prefiltering and challenges can make additional model calls."
    • addedInput schema / properties / model / description
      Added value: +"LLM model name passed to the provider (e.g. gpt-4.1 or a Claude model). Configure the provider's credentials in the MCP server's environment when required by that provider."
    • 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 declare readOnly and non-destructive, but the description adds context they do not carry: code snippets and search results leave the machine to the chosen provider, an extra (`skylos[llm]`) and provider credentials are required, results may remain unverified for uncertain or out-of-limit candidates, and no files are edited. The SKYLOS_API_KEY paragraph further discloses the exact failure mode (authentication error) plus a fallback path with a 5 calls/day limit.

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?

Core behavior and sequencing are front-loaded in the first two sentences, and each line carries signal. The closing paragraph is somewhat long and drifts into CLI details ('skylos verify <file>', 'skylos agent install-hooks') that are tangential to invoking this MCP tool.

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?

For a 6-parameter tool with an output schema, the description covers the missing pieces an agent needs: external data transmission, credential prerequisites and their failure mode, refusal conditions, and the possibility of partial results. Return-value detail is correctly left to the output schema.

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 the baseline is 3; the description only adds a light gloss on the review limits ('Candidates outside the review limits ... can remain unverified') without explaining `confidence`, `exclude_folders` merge behavior, or provider/model selection beyond what the schema states.

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 concrete verb and resource ('Ask an LLM to review selected unused function, class, import and variable candidates, with its reasoning') and explicitly positions the tool relative to a sibling ('Use it after `analyze`'), so an agent can distinguish it from `analyze` 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 Guidelines5/5

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

Names the trigger and the sequencing ('after `analyze` when you need fewer false positives before deleting code') and states a precondition for refusal ('Refuses to run when the static analysis was incomplete'), giving the agent both a when-to-use and an implicit when-not path.

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