Skip to main content
Glama

gitleaks_scan

Scan repositories and directories to uncover exposed secrets and credentials, using project history, staged changes, or direct file scanning. Outputs detailed findings with redacted secret values.

Instructions

Scan a repository or directory for secrets and credentials using Gitleaks.

Args: target: Local path to a Git repository or directory to scan. scan_type: Scan mode — detect (full repo history), protect (pre-commit staged changes), dir (scan directory without git history). report_format: Output format — json, csv, sarif. timeout: Override default timeout.

Returns: List of secret findings with rule ID, file, commit, description, and partially-redacted secret.

Note: - Target path must be under an allowed directory (/usr/share, /opt, $HOME, /tmp). - Use detect for comprehensive historical scans. - Use protect as a pre-commit hook to catch secrets before they are committed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
timeoutNo
scan_typeNodetect
report_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses important behavioral constraints such as target path restrictions ('must be under an allowed directory'), the three scan modes, output formats, and the return structure including 'partially-redacted secret'. It does not mention potential side effects or performance implications, but for a read-only scanner this is adequate.

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 concise and well-structured with clear sections (Args, Returns, Note). Every sentence adds useful information, and the total length is appropriate for the tool's complexity.

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 tool's moderate complexity, no annotations, and a schema with no descriptions, the description covers all essential aspects: parameters, return format, usage notes, and constraints. It is sufficient for an agent to select and invoke the tool correctly.

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

Parameters5/5

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

The schema has no property descriptions (coverage 0%), but the description compensates fully by explaining each parameter: target (path), scan_type with possible values and meanings, report_format with example formats, and timeout as an override. This adds substantial semantic value beyond the bare 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 clearly states the tool's function with a specific verb and resource: 'Scan a repository or directory for secrets and credentials using Gitleaks.' This distinguishes it from sibling scanners like trufflehog_scan by naming the underlying engine, making the purpose unambiguous.

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 Note section provides clear context for when to use each scan_type (e.g., 'Use detect for comprehensive historical scans', 'Use protect as a pre-commit hook'), which guides parameter selection. However, it does not explicitly compare against alternative secret-scanning tools or state when not to use this tool, so alternatives are not addressed.

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/rfunix/tengu'

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