Skip to main content
Glama

scan_secrets

Detect leaked API keys, database passwords, private keys, and token assignments in source files and Git history; report findings by file and line with secret values redacted.

Instructions

Preflight check #2: scan a project directory for secrets (service_role, Stripe/OpenAI/AWS keys, DB URLs with passwords, private keys, generic SECRET/TOKEN assignments) in source files and git history. Uses gitleaks when available, otherwise a built-in regex scan. Public-by-design keys (anon/publishable/pk_) are reported as Baixa. Secret VALUES are never returned — only variable/pattern name, file and line.

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": {
      "target": "<target>"
    },
    "name": "scan_secrets"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYesAbsolute or relative path to the project directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses the gitleaks fallback to built-in regex scanning, the handling of public-by-design keys as Baixa, and that secret values are never returned. It stops short of stating read-only guarantees, permission needs, or scan depth/history behavior.

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 front-loaded and dense with useful information. The parenthetical secret list and behavioral notes each earn their place, with no redundant or filler wording.

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?

For a one-parameter scanning tool with no output schema, the description is largely complete: it covers detection scope, engine fallback, special-case severity, and output privacy. It could be stronger by specifying output format, git history depth, or performance/configuration expectations.

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?

The schema already documents the single target parameter at 100% coverage. The description reinforces that target is a project directory but adds no path syntax, relative-vs-absolute handling, or other parameter-specific meaning beyond the 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 states a specific verb and resource: scan a project directory for secrets. It enumerates concrete secret categories and clarifies coverage of both source files and git history, making the tool's purpose clear without needing the schema.

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 phrase "Preflight check #2" places the tool in a preflight workflow and gives clear context for when it applies. However, it does not explicitly say when not to use it or how it relates to siblings like scan_red_flags or check_db_policies.

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