Skip to main content
Glama

repo.apply_patch

Apply unified diff patches to local repositories with validation, sandbox enforcement, and rollback on failure.

Instructions

Apply a unified diff patch with validation, sandbox enforcement, and rollback

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchYesUnified diff patch string
dry_runNoValidate only without writing (default false)
Behavior4/5

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

With no annotations provided, the description carries the full burden of disclosure. It goes beyond the tool name by mentioning validation, sandbox enforcement, and rollback, giving users insight into safety and error-handling behavior. However, it does not elaborate on specific failure modes or permission requirements.

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?

The description is a single, well-structured sentence that front-loads the core action ('Apply a unified diff patch') and then lists key features. Every word earns its place, with no fluff or repetition.

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 mutation nature and lack of annotations/output schema, the description provides a solid overview with validation and rollback features. It could be more complete by specifying return values or exact behavior on failure, but it is sufficiently informative for a two-parameter tool with 100% schema coverage.

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?

The input schema fully describes both parameters (patch and dry_run) with 100% coverage. The description adds minimal extra meaning, though it aligns with the dry_run parameter by mentioning validation. Baseline of 3 is appropriate since the schema already handles parameter documentation.

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 with a specific verb: 'Apply a unified diff patch.' It also lists key features (validation, sandbox enforcement, rollback) that distinguish it from sibling tools like repo.search, repo.read_file, and git.diff, which are read-only or diff-generating operations.

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 description implies usage by describing the action, but it does not explicitly state when to use this tool versus alternatives, nor does it mention when not to use it. Sibling tools like git.diff generate patches, so it is inferred that apply_patch is for applying them, but no direct comparison or exclusion is given.

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/bgorzelic/ghostlink'

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