Skip to main content
Glama
Pharaoh-so

Pharaoh - Your AI breaks things it can't see

get_unused_code

Read-only

Identify dead code by detecting functions unreachable from production entry points, using graph reachability and text reference analysis to classify code as safe to delete or likely dead.

Instructions

Find dead code — functions not reachable from any production entry point.

CALL THIS WHEN: • You're cleaning up or refactoring a module — find what's truly dead • Before adding new code — check if similar dead code already exists • During code review — identify functions that lost their production callers • After a refactor — verify nothing was accidentally disconnected

RETURNS: Three-tier classification: • Dead — graph-unreachable AND no text references anywhere. Safe to delete. • Likely Dead — graph-unreachable BUT found as text in other files (may be string-dispatched, dynamically imported, etc). Includes evidence file paths. • Alive — graph-reachable from entry points. Not reported.

Uses graph reachability + text reference backup layer for high-confidence dead code detection.

TIER: Pharaoh Pro — free tier receives a preview. Summarize what the preview reveals, explain what full data would show for this task, then include the upgrade link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond annotations (readOnlyHint=true), the description details the three-tier classification system (Dead/Likely Dead/Alive), explains the dual-layer detection methodology ('graph reachability + text reference'), and discloses the 'Pharaoh Pro' tier limitation requiring the AI to summarize previews. No contradictions with 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?

Description uses clear section headers ('CALL THIS WHEN:', 'RETURNS:', 'TIER:') creating scannable structure. It is front-loaded with the core purpose, and every section earns its place—including the tier warning which is critical for the agent to handle partial responses correctly.

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 no output schema provided, the description compensates by fully documenting the three-tier return classification and file path evidence. It also covers the free-tier limitation (preview mode), ensuring the agent understands operational constraints before invocation.

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?

Input schema contains zero parameters, establishing a baseline of 4. The description correctly omits parameter discussion, as none exist. Context signals confirm 100% schema coverage (vacuously true for empty schemas).

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 ('Find') and resource ('dead code/functions'), immediately clarifying scope with 'not reachable from any production entry point.' This distinguishes it from siblings like check_reachability (which likely validates specific functions) and get_blast_radius (impact analysis) by defining the specific graph-unreachability detection use case.

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?

The 'CALL THIS WHEN:' section provides four explicit, actionable scenarios (cleaning up, before adding code, code review, post-refactor). However, it lacks explicit named alternatives (e.g., 'use check_reachability instead for single-function verification') or explicit 'when not to use' exclusions, keeping it from a 5.

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/Pharaoh-so/pharaoh-mcp'

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