Skip to main content
Glama

scan_codebase_for_secrets

Read-onlyIdempotent

Walk a directory tree to flag plausible hardcoded secrets using regex heuristics and entropy scoring. Run this read-only audit before commit or release to catch leaks in a repo.

Instructions

[scan] Walk a directory tree and flag plausible hardcoded secrets using regex heuristics plus Shannon-entropy scoring on string literals. Use as a one-shot 'is anything leaking in this repo?' audit before commit/release; prefer lint_files when you already know the specific files to check (and want optional auto-fix). Read-only — never modifies source files. Honors .gitignore. Returns JSON array of { file, line, key, value, kind } findings, or 'No hardcoded secrets found in the specified directory.' when clean. False positives are possible — review before treating as ground truth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirPathYesDirectory to scan, absolute or relative to the server cwd. The scan recurses into subdirectories.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.7
    • changedInput schema / properties / dirPath / description
      Previous value: -"Absolute or relative path to the directory to scan"New value: +"Directory to scan, absolute or relative to the server cwd. The scan recurses into subdirectories."
  2. Addedv0.11.5

TDQS

A4.5/5.0
Behavior4/5

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

Adds real context beyond the annotations: it honors `.gitignore`, never modifies source files, returns a defined JSON finding shape, and warns that false positives are possible and require review. The safety profile (read-only) is already covered by the annotations, so the description's additional value is the gitignore behavior and the false-positive caveat.

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?

Dense but every sentence earns its place: scope, technique, routing to the alternative, read-only guarantee, gitignore behavior, return shape, and the false-positive caveat. Front-loads what the tool does before the caveats, with no filler.

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?

No output schema exists, and the description compensates by describing the JSON finding fields and the clean-result string. Combined with the routing guidance and caveats, an agent has everything needed to invoke and interpret this tool 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% for the single `dirPath` parameter, so the schema already documents its semantics and recursion. The description only restates 'walk a directory tree' without adding format or edge-case guidance, so the baseline of 3 is appropriate.

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 and resource ('scan' a directory tree for hardcoded secrets') plus the technique used (regex heuristics plus Shannon-entropy scoring). It also distinguishes itself from the sibling `lint_files`, so an agent can tell the two apart without opening either schema.

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?

Explicitly frames the tool as a one-shot 'is anything leaking in this repo?' audit before commit/release and names the alternative (`lint_files`) with the exact condition that should route the agent there (known specific files, optional auto-fix). When-to-use and when-to-prefer-alternatives are both present.

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