Skip to main content
Glama

Memoreal — Deterministic AI Memory & Code Intelligence MCP

Detect Unreferenced Dead Code Candidates

dead_code
Read-onlyIdempotent

Identify indexed symbols that have zero callers outside their own definition. Use when auditing repositories for unreferenced functions, orphaned classes, and cleanup candidates.

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": {
      "namespace": "<namespace>"
    },
    "name": "dead_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
namespaceYesLogical workspace namespace.
entrypointsNoAdditional entrypoint file paths or symbol names to exclude.

Output Schema

NameRequiredDescriptionDefault
countYes
namespaceYes
candidatesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description only needs to add analytical caveats. It contributes the useful qualifier 'indexed' (results derive from an index, so they may be stale or partial) and 'outside their own definition', but omits the material caveat that dynamically dispatched or reflected references can produce false positives in dead-code detection.

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, zero filler. The operative definition is front-loaded and the usage cue follows immediately, which is the right ordering for a scanning tool.

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?

An output schema exists, so return values need not be explained, and the two-parameter surface is fully documented. The one gap is that the title calls these 'candidates' while the description states them as a flat fact ('zero callers'), leaving the agent without a warning that results are heuristic and require manual confirmation before deletion.

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

Parameters5/5

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

Schema coverage is 100%, so both parameters are already documented in the schema, and the description adds scope meaning on top: 'indexed symbols' frames what namespace selects and 'outside their own definition' clarifies the exclusion logic that entrypoints feeds into. It is not merely restating the schema.

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 gives a specific verb ('Identify') and a precisely bounded resource ('indexed symbols that have zero callers outside their own definition'), which is far more informative than the title's 'Dead Code Candidates'. It distinguishes the operation from reference-lookup siblings like find_references or call_tree by emphasizing the zero-caller predicate, though it never names an alternative explicitly.

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?

'Use when auditing repositories for unreferenced functions, orphaned classes, and cleanup candidates' gives a clear triggering context. It stops short of stating when NOT to use it (e.g., for live reference counting during a rename, where find_references is the better fit), so there is no exclusion guidance.

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.