Skip to main content
Glama

Apply workspace file patch (approval required)

filesystem.apply_patch
Destructive

Create a pending approval request for a narrowly scoped file patch. The patch changes only the specified file and applies after out-of-band approval.

Instructions

Create a PENDING approval request for a narrowly-scoped patch.

The patch may modify only the requested file, and is applied only after out-of-band approval via filesystem.apply_patch_approved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
patchYes
expected_hashNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
errorNo
changedNo
messageNo
outcomeYes
approvalNo
executedYes
new_hashNo
trace_idYes
additionsNo
deletionsNo
request_idNo
bytes_afterNo
bytes_beforeNo
previous_hashNo
approval_statusNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds meaningful non-structured behavior: no mutation occurs now, a pending request is created, and application requires an out-of-band approval step. It omits any concurrency/expected_hash behavior and what happens to a pending request that is never approved.

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 short sentences with no filler; the crucial fact (a pending request is created, not an applied change) is front-loaded in the first sentence.

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 values need not be explained, and the description covers the approval workflow that dominates this tool's behavior. The remaining gap is the undocumented expected_hash parameter and the lifecycle of an unapproved request.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across three parameters, so the description must carry the load. It only obliquely covers 'path' ('the requested file') and 'patch' ('narrowly-scoped patch'), and never mentions expected_hash at all, leaving a required-but-undocumented concurrency parameter.

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 and resource ('Create a PENDING approval request') plus the scope constraint ('narrowly-scoped patch'). It explicitly names the sibling that performs the actual application (filesystem.apply_patch_approved), so an agent can distinguish it from the approval counterpart without opening either schema.

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?

Gives clear context: this tool only stages a request, and the patch is applied only after out-of-band approval via filesystem.apply_patch_approved, naming the required follow-up tool. It stops short of telling the agent when to prefer a patch over filesystem.write_file for the same edit.

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