Skip to main content
Glama

verify_patch_integrity

Evaluate a proposed patch against deterministic AST anti-reward-hacking and safety rules, checking original versus patched files or a unified diff to flag unsafe or integrity-breaking changes.

Instructions

Evaluate a proposed patch (original vs patched files or unified diff) against 8 deterministic AST anti-reward-hacking & safety rules (RH001–RH008).

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": {
      "original_files": "<original_files>"
    },
    "name": "verify_patch_integrity"
  }
}

Input Schema

NameRequiredDescriptionDefault
unified_diffNoOptional unified diff string applied onto original_files.
patched_filesNoMapping of {rel_path: patched_source_code}.
original_filesYesMapping of {rel_path: original_source_code}.
max_files_touchedNo
max_lines_changedNo
allow_test_modificationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does usefully disclose that checks are deterministic AST rules with IDs RH001–RH008, implying reproducibility and traceability. It says nothing about whether the tool is read-only, what a violation report looks like, or how thresholds interact with results, which matters for a gate tool.

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?

A single front-loaded sentence with the object of evaluation before the rule set, and zero filler. It is as short as a definition of this scope can be.

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?

For a 6-parameter nested-input tool with no annotations and no output schema, the description should explain what is returned (violations, pass/fail signal) and what the numeric thresholds do. It omits both, and also gives no hint of what rules RH001–RH008 check beyond a category label.

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?

At 50% schema coverage the description supplies no per-parameter meaning, but the phrase 'original vs patched files or unified diff' does clarify the either/or relationship between patched_files and unified_diff that the schema only hints at via 'optional'. The three unlabeled tuning parameters (max_files_touched, max_lines_changed, allow_test_modifications) and their defaults are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Evaluate) plus resource (a proposed patch) and scope (8 deterministic AST anti-reward-hacking & safety rules RH001–RH008), with the two accepted input modes noted. It does not distinguish itself from the sibling audit_unified_diff, which plausibly covers adjacent ground, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No statement of when to call this versus audit_unified_diff, apply_transactional_patch, or localize_fault, and no preconditions such as 'call before applying a patch'. The gate-style use case is only inferable from the name and rule framing.

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