Skip to main content
Glama

scan_tree

Read-onlyIdempotent

Scans project files for exposed secrets, returning read-only, redacted findings and respecting .gitignore in Git repositories.

Instructions

Scan the files of a project directory for secrets. Read-only; values are redacted.

Detects AWS, GitHub, GitLab, Slack, Stripe, Google, OpenAI, Anthropic, npm, PyPI and SendGrid keys, JWTs, PEM private key blocks, passwords inside URLs, and generic high-entropy values assigned to names like password/secret/token/api_key. In a git repository it scans exactly what git add . would pick up (tracked files plus untracked files that are not ignored), so .gitignore is respected. It skips binaries, files over 1 MB, lockfiles and vendored directories (node_modules, vendor, .venv, ...). It does not follow symlinks.

Each finding shows: severity, id (f-), rule, file:line, and the value as 'first 4 chars + length' (short secrets show no characters). Findings listed in /.secretscan-ignore are suppressed.

Args: path: project directory (absolute or relative to the server's working directory). max_findings: cap on findings listed, highest severity first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "scan_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
max_findingsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Well beyond the annotations, the description discloses redaction format ('first 4 chars + length', none for short secrets), symlink non-following, size and path exclusions, suppression via <repo>/.secretscan-ignore, and finding shape (severity, f-<fingerprint> id, rule, file:line). These are exactly the operational details an agent needs to interpret results and avoid misreading redacted values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and read-only status, then progressively finer scope and output detail in short sentences and a compact args block. The dense enumeration of key vendors is slightly long but each clause adds detection scope that affects result interpretation.

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?

Complete for a two-parameter scanner: purpose, scope rules, exclusions, suppression mechanism, and finding fields are all stated, and an output schema exists for structural return details. Nothing needed to invoke it correctly or interpret a result is missing.

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 description coverage is 0%, so the description carries the full burden and does it: path is clarified as absolute or relative to the server's working directory, and max_findings is defined as a cap with highest-severity-first ordering, which is behavioral meaning absent from the schema's bare integer type.

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?

Opens with a specific verb and resource ('Scan the files of a project directory for secrets') and immediately bounds the scope with 'Read-only; values are redacted.' The enumeration of detected credential families plus the git-add/.gitignore scoping rule makes the tool's footprint unambiguous and implicitly separates it from a history scanner sibling.

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?

Clear context is given for when this applies: a project directory working set, tracked plus non-ignored untracked files, with binaries, >1 MB files, lockfiles and vendored dirs excluded. It does not explicitly name when to prefer a sibling such as scan_history or check_gitignore, so an agent must infer the boundary between working-tree scanning and history scanning.

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