Skip to main content
Glama

Apply patch

apply_patch
Destructive

Validate or apply a unified diff to a project safely: dry-run by default, confines changes to the project root, refuses mass deletions, and backs up files before writing.

Instructions

Apply a unified diff to the project. Defaults to dryRun=true. All target paths are confined to the project root, suspicious mass deletions are refused, and touched files are backed up before writing. Validates that every hunk applies cleanly first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchYesA unified diff to apply.
dryRunNoValidate without writing (default). Set false to actually apply.
projectPathYesAbsolute path to the project root.
createBackupNoBack up touched files under .mcp-flow-backups/ before writing.
Behavior5/5

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

The description goes far beyond the annotations, detailing crucial behaviors: dryRun defaults to true, path confinement, refusal of suspicious mass deletions, backups, and pre-validation of hunks. Even though annotations already mark it as destructive, the description adds substantial safety context and mitigations.

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, front-loaded with the primary action, and every clause adds value regarding defaults, constraints, or safety. No redundant or filler content.

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?

Given the tool's complexity and lack of output schema, the description covers the key operational aspects: default dryRun, path restrictions, deletion safeguards, backups, and validation. It does not mention the return format or error reporting, which is a minor gap for an agent needing confirmation of success.

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% and all parameters have clear descriptions. The tool description reiterates the dryRun and backup defaults but adds no new syntax or parameter-level meaning beyond the schema. Therefore a baseline score of 3 is appropriate.

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?

The description clearly states the tool's function: applying a unified diff to the project. This is a specific verb-resource pairing that distinctly separates it from siblings like generate_patch (which creates patches) and inspect_project (which reads).

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?

The description provides clear context for when to use this tool—when you have a patch to apply—and highlights key behaviors like default dryRun and validation. However, it does not explicitly mention alternatives or when not to use it, so it falls short of full 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/remimenguy/mcp-flow'

If you have feedback or need assistance with the MCP directory API, please join our Discord server