Skip to main content
Glama

Execute an approved file patch

filesystem.apply_patch_approved
Destructive

Executes the exact patch from an approved request using only its request_id; the saved snapshot is single-use.

Instructions

Execute exactly the patch stored in an APPROVED request.

Takes only a request_id; the stored snapshot is used. Single-use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
request_idYes

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

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and non-read-only, so the safety profile is covered. The description adds genuine value beyond that: the patch is taken from a stored snapshot, the caller supplies nothing but an id, and the invocation is single-use. It does not disclose failure/consumption behavior on error.

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?

Three short sentences, zero waste, with the action and its precondition front-loaded before the parameter and lifecycle notes.

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 annotations cover the destructive profile. The description covers the approval prerequisite, snapshot source, and single-use nature; only post-failure behavior is unaddressed, which is minor.

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

Parameters4/5

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

Schema description coverage is 0% and there is one parameter, so the description carries the burden. It clarifies that request_id is the sole input, that the patch content cannot be supplied or overridden, and that a stored snapshot is used — meaningfully constraining what the id refers to.

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?

Specific verb+resource: 'Execute exactly the patch stored in an APPROVED request.' The 'APPROVED' qualifier implicitly differentiates it from the sibling filesystem.apply_patch without naming it. Clear, though it never explicitly names the alternative sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The word 'APPROVED' implies the prerequisite that a prior approval must exist, and 'Single-use' hints at the invocation constraint. However, it never states when to prefer this over filesystem.apply_patch, or what to do if the request is not approved.

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