Skip to main content
Glama

dead_code

Read-onlyIdempotent

Identify non-test functions that nothing calls and no test executes, excluding dunders and main, and list the last author and date for each deletion candidate.

Instructions

Non-test functions that nothing calls and no test executes (dunders and main excluded), with who last touched them. Candidates for deletion. Returns {count, functions: [{qualname, module, last_author, last_date}]}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "dead_code"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so safety is covered. The description adds substantive context beyond them: the inclusion criteria, the explicit exclusions for dunders and `main`, and the full return shape with per-function author/date. It does not disclose analysis limitations (false positives from dynamic calls) or cost.

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?

Two sentences, front-loaded with the definition and exclusions, then the return shape. No filler, no repetition of the tool name, and the exclusion parenthetical is placed exactly where it prevents a misreading.

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 zero parameters and no output schema, the description carries the return contract itself and does so fully ({count, functions: [{qualname, module, last_author, last_date}]}). What is missing is only the interpretive caveat that these are heuristic candidates, which matters for a deletion-oriented tool.

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?

The tool takes zero parameters, so there is no parameter semantics to explain and the baseline applies. The description instead spends its words documenting the return payload, which is the more useful information here.

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?

The description names the exact resource and criteria: non-test functions with no callers and no test execution, with dunders and `main` explicitly excluded. That is a precise, testable definition rather than a restatement of the name. It stops short of naming a sibling (e.g. `untested`) to draw the boundary against, so the agent must infer differentiation itself.

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

Usage Guidelines3/5

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

'Candidates for deletion' implies the downstream use case and the exclusion rules imply the intended scope. However, there is no explicit guidance on when to reach for this versus `untested`, which overlaps on the 'no test executes' criterion, and no note on when results should not be trusted (dynamic dispatch, reflection, entry points).

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