Skip to main content
Glama

scan_secrets

Read-only

Recursively scans directories like decompiled APK output for hardcoded secrets, returning redacted, confidence-scored candidates with fingerprints for review.

Instructions

Recursively scan a directory (typically decompile_apk or decode_apk output) for likely hardcoded secrets using a multi-detector registry: AWS/Google/Azure keys, private key headers, GitHub/GitLab/Slack/Stripe/Twilio/SendGrid/Mailgun/NPM/PyPI tokens, JWTs, webhook URLs, and high-entropy key shapes. Each hit is scored into a redacted secret candidate with a detector, confidence (low/medium/high), the signals behind it (entropy, context keywords, placeholders), and a SHA-256 fingerprint - the secret value itself is never included, the context line is returned with the match replaced by [REDACTED:]. Not exhaustive, and not a replacement for a maintained secret scanner. Only reads files; skips files over 2 MB. Returns { dirPath, filesScanned, detectors, candidateCount, byConfidence, candidates: [{ detector, file, line, context, preview, length, fingerprint, confidence, signals }], truncated }. Candidates are also indexed into the knowledge graph as secret-candidate entities. For your own patterns use search_code. The full redacted result is also saved as a JSON file in the workspace and its path returned as outputPath, so it can be cited as evidence.

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

Input Schema

NameRequiredDescriptionDefault
dirPathYesAbsolute path of the directory to scan, e.g. the outputDir from decompile_apk. Must exist.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".
extensionsNoOnly scan files with these extensions - lowercase, with the leading dot, e.g. [".java", ".xml"]. Omit to scan every file except known binary types (.apk, .dex, .zip, .jar, .so, images, fonts).
maxResultsNoStop after this many matches. Default and maximum 200.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.3.7
    • changedInput schema / properties / dirPath / description
      Previous value: -"Directory to scan, e.g. a jadx output directory"New value: +"Absolute path of the directory to scan, e.g. the outputDir from decompile_apk. Must exist."
    • changedInput schema / properties / extensions / description
      Previous value: -"File extensions to include, e.g. [\".java\", \".xml\"]. Omit to scan all non-binary-looking files."New value: +"Only scan files with these extensions - lowercase, with the leading dot, e.g. [\".java\", \".xml\"]. Omit to scan every file except known binary types (.apk, .dex, .zip, .jar, .so, images, fonts)."
    • addedInput schema / properties / maxResults / default
      Added value: +200
    • changedInput schema / properties / maxResults / description
      Previous value: -"Cap on results, default/max 200"New value: +"Stop after this many matches. Default and maximum 200."
    • addedInput schema / properties / maxResults / maximum
      Added value: +200
    • addedInput schema / properties / maxResults / minimum
      Added value: +1
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. First observedv1.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint=true and openWorldHint=false, it discloses that only files are read, that files over 2 MB are skipped, that results are capped, that hits are scored into confidence tiers with signals and SHA-256 fingerprints, that secret values are never emitted (replaced with [REDACTED:<length>]), and that candidates are indexed into the knowledge graph. These are meaningful behaviors the annotations do not convey.

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?

The purpose and scope come first, followed by detection coverage, then output/behavior, then the sibling alternative. It is dense with a long detector list that borders on verbose, but each clause carries information an agent would otherwise have to infer.

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, the description fully specifies the return object shape (dirPath, filesScanned, detectors, candidateCount, byConfidence, candidates fields, truncated) and notes the saved JSON outputPath. Nothing needed to call or interpret the tool is missing.

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 coverage is 100% and the parameter descriptions already explain dirPath, workspace, extensions defaults, and the maxResults cap. The description adds only marginal context (default binary-type skipping, the decompile-output convention) beyond what the schema states, so the baseline 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?

The description opens with a specific verb and resource: "Recursively scan a directory ... for likely hardcoded secrets" and immediately scopes the typical input to decompile_apk or decode_apk output. It enumerates the detector families covered, so an agent can tell this apart from search_code without opening 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives the typical input source, states the boundary ("Not exhaustive, and not a replacement for a maintained secret scanner"), and routes custom-pattern work to search_code explicitly. That covers when to use it, its limits, and the alternative.

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