Skip to main content
Glama

neurocode_validate_patch

Verify proposed code patches before writing by checking the target search block exists and the replacement parses with zero AST syntax errors.

Instructions

Pre-flight verification for proposed code patches. Checks that the target search block exists in the file and verifies that the replacement parses as valid syntax with zero AST syntax errors before writing to disk.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "neurocode_validate_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
patchNoAlternative: full SEARCH/REPLACE diff text
file_pathNoRelative file path being modified
repo_pathNoPath to repository root (default '.').
search_blockNoOriginal code lines to match and replace
replace_blockNoNew replacement code lines

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses that the tool is non-mutating ('before writing to disk'), what exactly is verified (target block presence, replacement parses with zero AST syntax errors), and the failure condition (syntax errors). It does not disclose the response shape or whether failures raise versus return a status, which is the main remaining gap.

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?

Two tight sentences, front-loaded with the purpose and then the specific checks, with no redundant or filler wording. Nothing could be removed without losing 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?

For a validation-only tool with no output schema and no annotations, the description covers the essential behavior an agent needs: what is checked and that nothing is written. It is slightly incomplete on how results are reported and on the mutual exclusivity of the patch versus search/replace parameters.

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 coverage is 100%, so every parameter already has a description and the baseline is 3. The description adds the conceptual model of what search_block/replace_block mean operationally but never clarifies the relationship between the 'patch' alternative parameter and the search/replace pair, nor the fact that zero parameters are required — a meaningful ambiguity the description leaves unaddressed.

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?

The description gives a specific verb and resource ('Pre-flight verification for proposed code patches') and enumerates the two concrete checks performed: search-block existence and AST syntax validity of the replacement. It is clearly distinguishable from mutating siblings like neurocode_graft or neurocode_repair_ollama because it explicitly stops 'before writing to disk', though it never names an alternative tool.

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?

'Pre-flight' plus 'before writing to disk' establishes clear ordering context: call this ahead of applying a patch. There are no explicit exclusions, no statement about what to do if validation fails, and no named alternative for agents who want to apply the patch directly, which keeps it below a 5.

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