Skip to main content
Glama
gabyic

AgentDock MCP Harness

by gabyic

file.patch

Apply a text replacement only if the file's SHA-256 matches expected, avoiding stale edits. Relative paths use the task worktree; absolute paths use host OS.

Instructions

Patch an existing file if its SHA-256 still matches. Relative paths use the Task worktree; absolute paths use the host OS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
task_idYes
new_textYes
old_textYes
expected_sha256Yes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0-dev.2

TDQS

B3.3/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 disclosure burden. It is transparent that the operation is conditional on the current SHA-256 and explains how paths resolve. However, it does not disclose what happens when the SHA-256 does not match, whether the file must already exist, or what the tool returns on success or failure.

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 with no filler: the first front-loads the action and condition, the second gives the path-resolution rule. Every clause adds necessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema and no annotation support, so the description needs to cover failure behavior and parameter semantics. The path-resolution detail is valuable, but the missing SHA-mismatch behavior and lack of explicit old_text/new_text semantics leave an agent under-equipped for safe invocation.

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%, so the description must compensate. It adds meaning for path (worktree vs host OS) and expected_sha256 (the match condition), but it does not explicitly explain task_id or define old_text/new_text as find-and-replace strings. The parameter names are self-descriptive, but the description only partially fills the schema gap.

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 operation—patch an existing file—and the condition under which it applies (SHA-256 match). It does not explicitly spell out that old_text is replaced by new_text, so some semantics are left to inference, but the resource and action are clear enough to distinguish it from file.write.

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?

The description gives a concrete path-resolution rule for relative vs absolute paths, but it provides no guidance on when to prefer file.patch over file.write or other sibling tools, and no exclusions or alternative conditions. The SHA-256 check implies optimistic concurrency, but that use case is never stated.

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