Skip to main content
Glama

Patch

patch
Destructive

Applies structured OpenCode/Codex file-change envelopes with add, update, move, and delete directives, validating every hunk before writing any file.

Instructions

Apply an OpenCode/Codex patch envelope with *** Begin Patch, *** Add File, *** Update File, *** Move to, and *** Delete File. All hunks are validated before any file is written.

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": {
      "patchText": "<patchText>"
    },
    "name": "patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
patchTextYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=false, so the safety profile is covered structurally. The description adds genuinely new behavioral context beyond them: patches are validated up front and applied only after all hunks pass, implying all-or-nothing semantics — exactly the risk information an agent needs before a destructive batch write.

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 sentences, both earning their place: the format/dialect declaration first, the atomicity guarantee second. No filler, and the most decision-relevant constraint is front-loaded.

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?

An output schema exists, so return-value explanation is unnecessary, and the annotations cover the destructive/non-idempotent profile. The description supplies the atomic validation guarantee and the accepted dialect, though it omits failure behavior (what happens to already-written files if a hunk fails mid-apply) and whether non-existent target paths are an error.

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 0% and the single parameter 'patchText' carries no schema-level documentation, so the description has to compensate. It partly does by naming the required envelope markers and identifying the dialect as OpenCode/Codex, but it gives no detail on line-prefix conventions, context-line syntax, or hunk ordering, so an agent still cannot compose a valid patch from the description alone.

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 states a specific verb and resource ('Apply an OpenCode/Codex patch envelope') and enumerates the recognized section markers (*** Add File, *** Update File, *** Move to, *** Delete File), which tells an agent this is a bulk, format-specific mutation rather than a free-form edit. It stops short of naming the obvious siblings (edit, write) to sharpen the distinction.

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?

There is no explicit when-to-use guidance: nothing says to prefer this over 'edit' for multi-file changes or over 'write' for whole-file creation, and no preconditions (target paths, existing file requirements) are stated. Usage is only inferable from the format markers listed.

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

Deploy Server

Other Tools