Skip to main content
Glama

Pre-Commit Secret & Artifact Guard

scan_precommit_guard

Scan repositories, diffs, or file lists for leaked secrets, private keys, large blobs, and build artifacts before commit; get masked findings, a risk score, and PASS/WARN/BLOCK remediation guidance.

Instructions

Scan a repository, unified diff, or file list for leaked .env files, cloud/LLM API keys, JWTs, private keys, high-entropy secrets, large/binary blobs, local DBs, and build artifacts. Returns masked findings, 0-100 risk score, PASS/WARN/BLOCK verdict, and remediation commands.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "scan_precommit_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
diffNoOptional raw unified diff text to scan in memory.
filesNoOptional array of files and contents to scan in memory.
repoPathNoRepository path to scan (read-only). Defaults to current working directory if diff and files are omitted.
allowedPathsNoOptional allowlisted relative paths to skip.
includeUntrackedNoInclude untracked files in repository scans (default: true).
largeFileThresholdBytesNoLarge blob warning threshold in bytes (default: 1048576 = 1 MiB).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations at all, the description must carry the full behavioral burden, and it does disclose the meaningful return shape: masked findings, a 0-100 risk score, PASS/WARN/BLOCK verdict, and remediation commands — the masking detail is genuinely valuable. However, it says nothing about whether the scan mutates anything, what permissions or auth are needed, how long a repo scan takes, or how verdict thresholds are chosen.

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?

Two sentences, front-loaded with the verb and the accepted input sources, then the outputs. The long detection enumeration is dense but each term carries real information; only mild tightening is possible.

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 6-parameter tool with full schema coverage and no output schema, the description covers both input modes and the return contract (masked findings, score, verdict, remediation). The one notable gap is what happens when multiple input sources are provided simultaneously or how allowedPaths interacts with the in-memory modes.

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 description coverage is 100% across all 6 optional parameters, so the schema already documents diff, files, repoPath, allowedPaths, includeUntracked, and the threshold. The description adds no parameter-level meaning (e.g., precedence when both diff and files are supplied), so the baseline 3 is appropriate.

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?

"Scan" is a specific verb applied to three explicit input sources (repository, unified diff, file list), and the description enumerates exactly what it detects (.env files, cloud/LLM keys, JWTs, private keys, entropy, binaries, DBs, build artifacts). That detection scope alone distinguishes it from siblings like diff_structural_json or plan_atomic_commits without needing to name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The title and detection list imply a pre-commit/pre-push use case, and the schema notes repoPath defaults to cwd when diff/files are omitted, but the description itself never states when to choose this tool over analyze_blast_radius or plan_atomic_commits. No explicit when-not-to-use or input-precedence guidance is given.

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