scan_git_staged
Scan git staged changes for exposed secrets before committing, reporting redacted findings with file and line locations.
Instructions
Scan ONLY the lines currently staged for commit (git diff --cached).
This is the pre-commit checkpoint: it inspects exactly the content the next commit would publish, and reports the file and post-commit line number of every added secret. Local diff settings (external diff tools, textconv filters, prefixes, path quoting) are overridden, and git runs no configured programs.
Args: repo_path: Absolute path to a git repository (or any path inside one). max_findings: List at most this many findings, most severe first (default 200, 0 = no limit).
Returns: The standard redacted findings report. If nothing is staged the result is clean with an explanatory summary.
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": {
"repo_path": "<repo_path>"
},
"name": "scan_git_staged"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | ||
| max_findings | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clean | Yes | ||
| summary | Yes | ||
| findings | Yes | ||
| baselined | No | ||
| top_files | No | ||
| truncated | No | ||
| suppressed | No | ||
| files_scanned | Yes | ||
| total_findings | No | ||
| counts_by_pattern | No | ||
| counts_by_severity | No |