generate_fix_prompt
Generate a prompt that instructs an LLM to produce a unified diff patch for a cached security finding, using an expanded source window for context.
Instructions
Build an LLM-ready prompt to fix a cached finding as a unified diff.
Recovers the finding (by hash) from the scan cache, extracts an expanded
window of the vulnerable source, and returns a prompt engineered to make
an LLM emit a strict unified diff. After generating the patch, apply it
with apply_patch.
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": {
"target_path": "<target_path>",
"finding_hash": "<finding_hash>"
},
"name": "generate_fix_prompt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_path | Yes | Root of the scanned project (must have a `.sast-mcp-cache`). | |
| finding_hash | Yes | Hash of the finding to remediate (shown in scan output). | |
| context_window | No | Source lines to include before/after the finding. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |