Skip to main content
Glama

vault_patch

Surgically find and replace text in vault files, with optional automatic git commit for single or multiple replacements.

Instructions

Surgical find-and-replace in a vault file with auto git commit.

Supports single or multi-replacement. For a single replacement, provide find and replace. For multiple replacements, provide patches — a list of {"find": "...", "replace": "..."} dicts applied in sequence. Do not mix both modes.

Each find value must appear exactly once in the file (after prior patches in the list have been applied). If any patch fails validation, no changes are written.

Uses 3-pass cascading match: exact → body-only → whitespace-normalized.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject slug or '_meta' for cross-project content.
pathYesRelative path to the file within the project.
findNoExact text to find (single mode). Empty = not set.
replaceNoReplacement text (single mode). Empty = not set.
patchesNoList of {"find", "replace"} dicts (multi mode).
commitNoIf True (default), auto-commit. If False, write to disk without committing — useful for batching many patches into one ``vault_commit`` flush. See ``vault_write`` docstring for the durability contract.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations provide readOnlyHint=false, destructiveHint=false. The description adds auto git commit, validation rollback, and 3-pass cascading match, which are not obvious from annotations alone. No contradiction.

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 compact and front-loaded: a summary line followed by clear sections for modes, validation, and matching algorithm. Every sentence adds value without redundancy.

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

Completeness5/5

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

With full parameter coverage, an output schema (present), and clear constraints (mixing modes forbidden, validation, matching algorithm), the description leaves no gaps for this moderately complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description enhances understanding by explaining the mode distinction (find/replace vs. patches), the validation condition, and the commit parameter's batching purpose, all beyond schema descriptions.

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 starts with 'Surgical find-and-replace in a vault file with auto git commit,' clearly stating the verb and resource. It distinguishes from siblings like vault_write and vault_commit by focusing on patching with validation and auto-commit.

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?

It explains single vs. multi mode with explicit instructions: 'For a single replacement, provide find and replace. For multiple replacements, provide patches... Do not mix both modes.' It also warns that each find must appear exactly once and that validation prevents partial writes, referencing vault_commit for batching.

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/mlorentedev/hive'

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