Skip to main content
Glama

vulnforge_inject_patch

Automatically patches vulnerable source code by parameterizing raw queries, adding security headers, and sanitizing DOM sinks to prevent injection and XSS.

Instructions

Synthesizes and automatically injects defensive patches into vulnerable code, converting raw queries to parameterized statements, adding headers, and sanitizing DOM sinks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoTarget filename (e.g. server.ts, db.ts)
sourceCodeYesThe vulnerable source code to remediate

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It conveys that the tool mutates code automatically and lists the transformation classes, but it never says whether the target file is overwritten on disk, whether changes are reversible, what permissions are needed, or whether patched source is returned instead of written. For an unannotated mutation tool this is a substantial gap.

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?

A single front-loaded sentence that leads with the core action and then lists the specific remediation techniques. It is efficient and wastes no words, though the trailing list of transformation types edges toward detail that could live in an output description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description should explain what the call yields – patched source text, a file write, or a status report – and it does not. Combined with silence on side effects on the 'filename' target, the definition leaves the agent unable to predict the result of invoking it.

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% – both 'filename' (with an example) and 'sourceCode' are documented in the schema itself. The description adds no parameter-level syntax, format, or constraint detail beyond what the schema already provides, so the baseline of 3 applies.

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?

States a specific verb ('synthesizes and automatically injects') and resource ('defensive patches into vulnerable code'), and enumerates the concrete transformations performed (parameterized statements, headers, DOM sanitization). This clearly separates it from the sibling audit_* and full_scan tools, which are read-only detectors rather than remediation.

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?

Usage is only implied: an agent can infer this is the remediation step taken after an audit surfaces vulnerable code, since it takes sourceCode and returns patched output. There is no explicit when-to-use statement, no prerequisite (e.g. 'run vulnforge_audit_* first'), and no guidance on when to choose this over the scan siblings.

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