Skip to main content
Glama

Rank a project's files by risk

scan_project
Read-only

Rank JavaScript and TypeScript files by risk density to decide which files deserve review first; test files are skipped unless includeTests is passed.

Instructions

Walk a directory and rank its JavaScript/TypeScript files by risk density — how concentrated the failure-prone code is, not how big the file is. Test files are left out by default; pass includeTests to rank them too. Deterministic and fast — no model call. Call this at the start of a code review to decide which files are worth your attention, instead of reading the tree in arbitrary order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of files to return (default 50)
verboseNoInclude the raw metric counts for every file (default false)
directoryYesAbsolute path to the directory to scan
includeTestsNoRank test files too — *.spec.*, *.test.*, and anything under __tests__/test/tests/spec/__mocks__ (default false). They rank high for a structural reason rather than a real one: mocked awaits read as async complexity. Turn this on to audit a suite's own complexity.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive), and the description adds meaningful traits beyond them: it is deterministic and requires no model call, test files are excluded by default, and the ranking metric is density-based rather than size-based. The return format itself is not described, which keeps it from a 5.

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?

Four sentences, each earning its place: the core behavior and metric come first, then the test-file caveat, then the determinism note, then the workflow recommendation. No filler.

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 no output schema, the description conveys what the tool conceptually returns (files ranked by risk density) and how to act on it, and annotations cover the safety profile. A brief note on output shape (list vs. scored entries) would close the remaining gap.

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 all four parameters including includeTests' exclusion patterns are already documented in the schema. The description only restates the includeTests default and purpose, adding little beyond the structured field, so the baseline of 3 applies.

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?

States a specific verb (walk/rank) and resource (JavaScript/TypeScript files in a project directory) with a precise metric definition: risk density, explicitly contrasted with file size. This clearly separates it from siblings like analyze_file and map_dependencies.

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?

Gives explicit timing guidance -- 'call this at the start of a code review' -- and frames the alternative as 'instead of reading the tree in arbitrary order'. It does not name a sibling tool as the alternative, but the workflow placement is unambiguous.

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