Skip to main content
Glama

patch_note_text_tool

Find and replace text anywhere in a note's body using exact or regex matching, with optional dry-run preview and replace-all count. Handles scattered single-note edits without requiring heading or block anchors.

Instructions

Find and replace text anywhere in one note's body — no heading/block-ref anchor required, unlike patch_note_tool. Cheaper than write_note_tool for a scattered single-note edit (e.g. bumping one enum value inside a long note). mode: 'exact' (default, literal substring) | 'regex'. count: max replacements (default 1, first match only); 0 = replace all. dry_run=True previews {replacements, preview, diff} without writing. Raises ValueError if find doesn't match anything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
findYes
modeNoexact
pathYes
countNo
vaultNo
dry_runNo
replaceYes
expected_revisionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the burden and discloses important behaviors: default first-match replacement, count=0 replacing all, dry_run not writing, and raising ValueError when find matches nothing. It stops short of explicitly stating the write behavior when dry_run is false and doesn't mention expected_revision concurrency behavior, but it is substantially transparent.

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: main purpose first, then sibling comparison, then parameter semantics, then error behavior. Every sentence adds useful information without 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?

For an 8-parameter mutation tool with no annotations, it covers purpose, alternatives, parameter semantics, dry-run behavior, and errors. Since an output schema exists, return values need not be described. Minor gaps remain around vault and expected_revision, but overall it is nearly complete.

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

Parameters4/5

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

Schema description coverage is 0%, so the description compensates well by explaining mode ('exact' default vs 'regex'), count semantics, and dry_run's preview output. It does not explain path, vault, or expected_revision, but the most behaviorally meaningful parameters are covered.

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?

Description opens with a specific verb and resource: "Find and replace text anywhere in one note's body." It also explicitly differentiates itself from patch_note_tool by noting it requires no heading/block-ref anchor, and from write_note_tool by being cheaper for scattered single-note edits.

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 names two sibling tools and gives concrete selection criteria: use this instead of patch_note_tool when no anchor is needed, and instead of write_note_tool for targeted single-note edits. This is explicit when-to-use guidance with alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.