Skip to main content
Glama

cos_graph_dead_code

Read-onlyIdempotent

Identify dead-code candidates by listing in-repo symbols with zero non-test inbound references. Filter by function, method, or class to focus cleanup.

Instructions

List in-repo symbols with zero non-test inbound references (dead-code candidates).

Surfaces functions / methods / classes that nothing (outside tests) calls, constructs, subclasses, or type-references — the inverse of centrality. Candidates only: dynamic-dispatch / CLI-registered / externally-called symbols may appear; verify with cos_graph_references before deleting.

Args: kind: Optional filter — function | method | class. Empty = all three. top: Max candidates returned (default 50, max 500). include_tests: Count test-sourced edges + include test files (default False).

Returns: JSON envelope with dead (list) + total_count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
kindNo
include_testsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety profile is covered. The description adds valuable behavioral nuance: it defines what counts as a reference, notes that results are candidates (not authoritative), and explains the include_tests flag alters edge counting. This exceeds mere scope scouting.

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 well-structured with a clear topic sentence, a caveat paragraph, and labeled Args/Returns sections. Every sentence adds value: the purpose, the nuance about candidates, parameter semantics, and return envelope info. No fluff or redundancy.

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?

Given the moderate tool complexity, 0% schema coverage, and no param enums, the description fully compensates: all three parameters are defined, the return format is mentioned, and critical caveats about false positives are included. The existence of an output schema further reduces burden, making this highly complete.

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 0%, so the description carries full parameter burden. It explains `kind` as a filter (function|method|class, empty=all three), `top` with default 50 and max 500, and `include_tests` as 'Count test-sourced edges + include test files'. This adds meaning far beyond the raw schema.

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 opens with a specific verb+resource: 'List in-repo symbols with zero non-test inbound references' and clarifies it as 'dead-code candidates'. It further distinguishes itself from siblings by noting it is 'the inverse of centrality', immediately separating it from related graph tools.

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?

The description explicitly warns that results are 'Candidates only' and that dynamic-dispatch/CLI-registered/externally-called symbols may appear, advising to 'verify with cos_graph_references before deleting'. This names the alternative tool and provides clear when-to-use and when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kouroshez/coding-os'

If you have feedback or need assistance with the MCP directory API, please join our Discord server