Skip to main content
Glama

apply_patch

Apply patch files to add, modify, or delete files safely, avoiding shell redirection for code edits.

Instructions

Safely add, update, delete, or move files inside the configured shell root using an *** Begin Patch / *** End Patch patch. Prefer this over shell redirection for code edits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchYesPatch text containing Add File, Update File, or Delete File operations.
Behavior2/5

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

The description labels the operation as 'Safely' apply a patch, implying a non-destructive or managed operation, but provides no specifics on what safety means, whether it checks for errors, or what side effects occur. With no annotations provided, the description carries the full burden, and this is insufficient for a file-modifying tool.

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?

Description is two sentences, front-loaded with the primary action and patch format, and the usage guidance is concise. No filler.

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

Completeness2/5

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

Given that this tool can modify files (possibly destructive), but has no annotations and output schema, the description is too sparse. It doesn't explain what 'safely' means, how errors are handled, or what happens on malformed patches. It covers the basic purpose but misses important context for a file-editing tool.

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 the schema describes the patch parameter as containing Add File, Update File, or Delete File operations. The description adds the patch markers and file operations list, but does not add depth on syntax or constraints. Baseline 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 applies a patch to add, update, delete, or move files within a specific root. It names the patch format and explicitly contrasts with shell redirection, distinguishing it from sibling tools like shell_command.

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

Usage Guidelines5/5

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

The description explicitly says 'Prefer this over shell redirection for code edits', providing direct usage guidance and an alternative to avoid. This distinguishes when to use this tool versus shell_command.

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/JonusNattapong/mcp-chatgpt'

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