Skip to main content
Glama

scan_codebase_for_secrets

Detect hardcoded secrets in any directory using regex heuristics and Shannon-entropy scoring. Use as a pre-commit audit to prevent credential leaks. Read-only, respects .gitignore, returns findings or clean confirmation.

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.
Behavior5/5

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

Even without annotations, the description fully discloses the tool is read-only, honors .gitignore, returns specific output format, and mentions the possibility of false positives. This provides complete behavioral context for the agent.

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 description is well-structured with the key verb at the start and includes essential details without unnecessary fluff. Slightly long but every sentence adds value; could be marginally more concise.

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?

Given the single parameter and no output schema, the description covers input, behavior, and return format thoroughly. It also mentions false positives and .gitignore handling, making it fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a good description for the 'dirPath' parameter. The tool description adds that the scan recurses into subdirectories, which is helpful context beyond the schema, but the schema coverage is already 100%.

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 clearly states the tool scans a directory for hardcoded secrets using regex heuristics and Shannon-entropy scoring. It distinguishes itself from sibling tool 'lint_files' by specifying its scope and purpose.

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 advises using the tool for one-shot audits before commit/release and notes when to prefer 'lint_files' instead. Also warns that false positives are possible and suggests review before treating as ground truth.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/I4cTime/quantum_ring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server