Skip to main content
Glama

patch

Apply unified diff patches to files while preserving original encoding and verifying context lines. Use dry_run mode to preview changes before applying them.

Instructions

Applies a unified diff patch to a file. Parses @@ hunk headers, verifies context lines, and applies changes. Encoding-aware: preserves original file encoding. Use dry_run=true to preview without modifying the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file to patch
patchYesUnified diff text (output of the diff tool)
dry_runNoPreview patch result without modifying the file (default false)

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/knewstimek/agent-tool'

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