Skip to main content
Glama

lb_patch_text_block

Destructive

Replace a text block in a UTF-8 file using exact matching, with a bounded fuzzy fallback when only one occurrence is expected.

Instructions

Replace a text block in a UTF-8 file. Uses exact replacement first and a bounded fuzzy fallback when one replacement is expected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
find_textYes
replace_textYes
expected_matchesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the destructive nature is known. The description adds valuable behavior beyond that: 'Uses exact replacement first and a bounded fuzzy fallback when one replacement is expected' reveals the matching strategy and the role of expected_matches. However, it does not explain edge cases like zero matches or multiple matches, but the provided detail is meaningful.

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 two concise sentences, front-loading the action and then adding behavioral detail. No wasted words; it is appropriately sized for the tool's complexity.

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

Completeness3/5

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

The description covers the core purpose and matching behavior but omits details about error handling, what happens if no match is found, or if expected_matches is greater than 1. For a destructive operation with no output schema, more guidance on failure modes would improve completeness. However, the essential calling information is present.

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?

Schema coverage is 0%, so the description must compensate. It indirectly explains expected_matches via 'when one replacement is expected', and implies find_text and replace_text are the texts involved. However, it does not explicitly describe each parameter or provide format details, leaving some interpretation to the agent. The parameter names are self-explanatory, so it partially compensates.

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 action: 'Replace a text block in a UTF-8 file', identifying the verb and resource. It also distinguishes itself from siblings like lb_write_text (which writes whole files) and lb_read_text (which reads) by focusing on targeted block replacement. The mention of exact replacement and fuzzy fallback adds further specificity.

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 its use case (targeted block replacement) but does not explicitly state when to choose it over alternatives like lb_write_text or when not to use it. It does not mention exclusions or alternative tools. The behavior described (exact then fuzzy) offers some guidance but lacks explicit comparison.

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