Skip to main content
Glama

generate_fix_prompt

Generates a structured prompt for an LLM to produce a unified diff patch to fix a cached security finding, using expanded source context for accurate remediation.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_pathYesRoot of the scanned project (must have a `.sast-mcp-cache`).
finding_hashYesHash of the finding to remediate (shown in scan output).
context_windowNoSource lines to include before/after the finding.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description discloses the core behavior: recovering a finding from cache, extracting a source window, and returning a prompt for a unified diff. It doesn't cover all behavioral aspects like side effects or error conditions, but it provides sufficient context for safe invocation.

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 with three sentences, front-loading the main purpose. Every sentence adds meaningful context without redundancy.

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?

Given the three parameters and existence of an output schema, the description is adequate. It explains the workflow and prerequisites (scan cache). The output schema exists but is not detailed, which is acceptable as per rules. Some information about the output format could add completeness.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by explaining that target_path requires a '.sast-mcp-cache' directory, finding_hash comes from scan output, and context_window specifies lines before/after. This goes beyond the schema descriptions.

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 builds an LLM-ready prompt to fix a cached finding as a unified diff, specifying the source recovery and output format. It distinguishes from sibling 'apply_patch' by indicating the patch should be applied after generation.

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 description implies usage for generating a fix prompt before applying, referencing 'apply_patch'. However, it does not explicitly state when to use this tool versus other remediation or scanning tools, nor does it exclude alternative approaches.

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/Skyrxin/sast-mcp-server'

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