# createApplyPatchTool

**Kind:** Function

**Source:** [`atloria-monorepo/libs/agent-core/src/tools/apply-patch.tool.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/tools/apply-patch.tool.ts#L654)

Create an `apply_patch` tool definition.

This tool accepts a patch in the Codex `apply_patch` format and applies
it to the filesystem. It supports creating, updating, and deleting files
in a single patch, with fuzzy context matching for reliable hunk application.

## Signature

```ts
function createApplyPatchTool(options: ApplyPatchOptions): ToolDefinition<TContext>
```

## Parameters

| Name | Type |
|---|---|
| `options` | `ApplyPatchOptions` |

**Returns:** `ToolDefinition<TContext>`
