Skip to main content
Glama

Scan for secrets

scan_for_secrets
Read-only

Scan code for hardcoded secrets like API keys, tokens, and credentials before writing or committing. Returns redacted findings to prevent leaks.

Instructions

Scans a code string for hardcoded secrets (AWS keys, Stripe keys, GitHub tokens, Google API keys, Slack tokens, private key blocks, JWTs, and generic high-entropy credentials assigned to secret/token/password/key-like variable names) BEFORE that code is written to a file or committed. Call this proactively whenever you are about to write, edit, or commit code that could plausibly contain a credential — config files, env handling, API client setup, tests with fixture values, or any snippet you're not 100% sure is clean — and again right before creating a commit or PR. Every reported line is redacted; the raw secret value is never returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to scan, as plain text (one file's contents, or any snippet).
filenameNoOptional filename to attribute findings to (for display only). Defaults to "input".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
findingsYes
Behavior5/5

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

Beyond the readOnlyHint=true annotation, the description reveals a critical behavioral trait: 'Every reported line is redacted; the raw secret value is never returned.' This is exactly the kind of context that helps an agent trust the tool and understand its constraints during use. No contradictions.

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 efficiently structured: first the core action and scope, then explicit use cases, then a security-relevant behavioral note. It is one long paragraph but every sentence earns its place, containing no fluff or repetition.

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 an output schema exists, the description doesn't need to explain return values. It fully covers what the tool does, when to invoke it, and a key behavioral guarantee (redaction). The annotations and schema complement the description to make it complete.

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 already thoroughly describes both parameters. The description adds no new param-level semantics, though it does reinforce the purpose of 'filename' as display-only in the narrative. Baseline is 3 due to high schema coverage; description adds minimal extra value.

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 ('Scans') and a detailed resource: a code string for hardcoded secrets, enumerating many secret types (AWS keys, Stripe keys, GitHub tokens, etc.). This goes far beyond a vague purpose and leaves no doubt about what the tool does.

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?

Explicit when-to-use guidance is provided: 'Call this proactively whenever you are about to write, edit, or commit code that could plausibly contain a credential' and 'again right before creating a commit or PR.' Specific scenarios (config files, env handling, API client setup, tests) are listed. It also implies using it as a safety net for uncertain code.

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/vladimirbakalov/secretguard-mcp'

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