Skip to main content
Glama
kvnpetit

SRC (Structured Repo Context)

by kvnpetit

Find dead code

find_dead_code
Read-onlyIdempotent

Identify unused functions, methods, classes, and types through heuristic analysis. Returns conservative candidates with confidence and limitations, allowing safe cleanup without removal.

Instructions

Conservatively identify unexported functions, methods, classes, and types with no visible references. Read-only heuristic analysis with confidence and limitations; never removes code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum candidates to return
directoryNoProject directory.
max_filesNoMaximum source files to inspect
include_testsNoInclude test/spec files in the analysis (default: false)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
metaYes
errorNo
messageNo
successYes
schema_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already provide readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral context: it is a heuristic analysis, conservative, reports confidence and limitations, and never removes code. This goes beyond the structured annotations.

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?

The description is two tight sentences with no redundancy. It front-loads the core purpose and immediately follows with safety and behavioral caveats, making every sentence earn its place.

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?

With full parameter documentation, a complete output schema, and annotations covering read-only/idempotent/non-destructive behavior, the description adds exactly the missing context: heuristic nature, conservatism, confidence, and the guarantee not to remove code. Nothing essential is missing for an agent to invoke it correctly.

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 four parameters (limit, directory, max_files, include_tests) are already fully documented in the schema. The description adds no additional parameter-level meaning, which is acceptable given the high schema coverage.

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?

The description states a specific verb ('identify'), a clear resource ('unexported functions, methods, classes, and types'), and a precise criterion ('no visible references'). This sharply distinguishes it from siblings like search_code or list_symbols, whose broader scopes are not about dead-code discovery.

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?

The description implies usage for conservative dead-code analysis and clearly signals a read-only, non-destructive role. However, it does not explicitly state when to prefer this tool over alternatives such as run_static_analysis or analyze_file, nor does it mention any exclusions or prerequisites.

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