Skip to main content
Glama

evaluate_patch

Verify a unified git diff patch against architectural constraints and functional test results before allowing merge, then append audit records and cryptographic seals for ctxfw.

Instructions

Verify a unified git diff patch (diff_text) against SWE-Gate architectural constraints (max_cyclomatic_delta, forbid_type_ignores, disallowed_import_modules) and functional test results (tests_passed, tests_failed, functional_verdict) before allowing merge. Appends immutable audit records (EVL-...) in SweGateStore and seals cryptographic blocks in TraceKitStore; use query_audit_ledger to retrieve or verify persisted records.

Input Schema

NameRequiredDescriptionDefault
pr_idNoPull request identifier (>= 1)
repo_idNoOptional repository identifier (REPO-...)
diff_textYesUnified diff text of the candidate patch
repo_nameNoRepository name (e.g. 'heuristico/ctxfw')heuristico/ctxfw
commit_shaNo40-character lowercase hex commit SHA
author_kindNoPatch author kind: 'AGENT' or 'HUMAN'AGENT
tests_failedNoCount of failing functional tests
tests_passedNoCount of passing functional tests
diff_size_bytesNoExact UTF-8 byte length of diff_text
functional_verdictNoFunctional test suite verdict: 'PASSED' or 'FAILED'
forbid_type_ignoresNoWhether introducing '# type: ignore' is forbidden
max_cyclomatic_deltaNoMaximum allowed cyclomatic complexity delta
disallowed_import_modulesNoList of banned module names that the patch must not import

Output Schema

NameRequiredDescriptionDefault
contentYesJSON-serialized SWE-Gate verification report or rejection message
isErrorYesTrue if the patch was rejected by SWE-Gate or failed validation

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.8.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and idempotentHint=false; the description goes beyond them by disclosing concrete write side effects (immutable audit records EVL-... in SweGateStore, sealed cryptographic blocks in TraceKitStore), which tells the agent this call mutates state and is not a dry run. It does not say whether records are still appended when the verdict fails, which is the remaining unknown for a mutation tool.

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?

Two sentences with no filler, front-loaded on the verification purpose with side effects and sibling routing deferred to the second sentence. The parenthetical parameter lists make it dense but each clause carries distinct information.

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?

With an output schema present, the description correctly avoids restating return values and instead covers the axes of evaluation, persistence side effects, and where to read results back. The open question of whether failed patches are still recorded in the audit ledger is the one behavior an agent would want before calling it repeatedly.

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 description coverage is 100%, so the baseline is 3, but the description adds semantic grouping the schema lacks: it clusters max_cyclomatic_delta, forbid_type_ignores and disallowed_import_modules as the architectural constraint set, and tests_passed, tests_failed, functional_verdict as the functional evidence. It stops short of explaining how diff_text is parsed or whether diff_size_bytes is derived or trusted.

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 names a specific verb and resource ('Verify a unified git diff patch') and enumerates the exact validation axes it applies (cyclomatic delta, type ignores, banned imports, functional verdict). It also clearly separates itself from siblings by assigning record retrieval to query_audit_ledger.

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 gating context is explicit ('before allowing merge'), and it routes the agent to the correct sibling for retrieval/verification of persisted records. There is no explicit when-not guidance or distinction from evaluate_spec_axioms / resolve_context_bundle, which is the only gap.

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