Skip to main content
Glama

evaluate_patch

Verify a git diff patch against architectural constraints and functional test results before merge, then append immutable audit records and seal cryptographic trace blocks.

Instructions

Verify a unified git diff patch (diff_text, with optional commit_sha, author_kind 'AGENT'|'HUMAN', pr_id, diff_size_bytes, repo_name, and repo_id) against SWE-Gate architectural constraints (max_cyclomatic_delta default 10, forbid_type_ignores default true, disallowed_import_modules) and functional test results (tests_passed default 1, tests_failed default 0, functional_verdict 'PASSED'|'FAILED') 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.

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": {
      "diff_text": "<diff_text>"
    },
    "name": "evaluate_patch"
  }
}

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.1/5.0
Behavior4/5

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

Annotations only declare the coarse profile (not read-only, not idempotent, not destructive, closed-world); the description adds the material behavior an agent cannot infer: it appends immutable EVL-prefixed audit records to SweGateStore and seals cryptographic blocks in TraceKitStore. This explains why idempotentHint is false and warns that invocation has persistent side effects, though it does not say what state is written when the patch fails the gates or whether the call errors or returns a verdict.

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?

Front-loaded with the action and the resource, and every clause carries signal — constraints, side effects, follow-up tool. It is a single extremely dense sentence with heavy parenthetical nesting, which hurts scanability for a 13-parameter tool, but there is no filler to cut.

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?

For a 13-parameter mutating evaluator with full schema coverage, existing annotations, and an output schema, the description covers purpose, gates, side effects, and post-call retrieval. The remaining gap is failure behavior — what happens when architectural or functional gates reject the patch — which matters for an agent deciding how to act on the result.

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% and all 13 parameters carry their own descriptions, defaults, and enum-like value hints, so the baseline is 3. The description largely restates schema content (defaults of 10, true, 1, 0) and adds the useful clarification that only diff_text is required while the rest are optional, but it contributes no new format or interaction semantics.

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 ('Verify') and resource ('unified git diff patch') plus the two gates it checks (SWE-Gate architectural constraints and functional test results) and the outcome it gates ('before allowing merge'). It also implicitly distinguishes itself from the sibling query_audit_ledger, which is named as the retrieval path for the records this tool writes.

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 phrase 'before allowing merge' establishes a clear call context, and the final clause routes the agent to query_audit_ledger when the goal is retrieving or verifying persisted records rather than evaluating a new patch. It does not explicitly exclude evaluate_spec_axioms or state preconditions such as required authentication, so it falls short of a full when/when-not statement.

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