Skip to main content
Glama

apply_text_spans

Apply multiple non-overlapping text span edits to a file using 0-based offsets. Specify start and end positions with replacement text, with optional guards and encoding preservation.

Instructions

Apply multiple non-overlapping normalized-text span edits using 0-based offsets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bomNopreserve
pathYes
spansYes
newlineNopreserve
encodingNopreserve
base_hashNo
final_newlineNopreserve

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations provided, so description must fully disclose behavior. It mentions non-overlapping constraint but omits details on mutation safety, atomicity, effect on file, or how 'base_hash' guard works.

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?

Single sentence with no redundancy. Front-loaded with key information.

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

Completeness2/5

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

Given complexity (7 parameters, no schema descriptions, no annotations, and many siblings), the description is too sparse. It fails to clarify 'normalized text', offset semantics, when to prefer this tool, or what the output schema contains.

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

Parameters1/5

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

Schema has 7 parameters with 0% description coverage in the top-level schema; nested $defs have minimal descriptions. Tool description adds no explanation of parameters like 'bom', 'newline', 'encoding', 'base_hash', or 'final_newline', leaving the agent without semantic context.

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 clearly states action ('apply'), resource ('multiple non-overlapping normalized-text span edits'), and key detail (0-based offsets). This distinguishes it from siblings like 'apply_text_edits' (likely singular) and 'replace_literal'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool instead of alternatives like 'apply_text_edits' or 'replace_literal'. The description only states what it does, not the context or prerequisites for use.

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/yun-wulian/file-mcp'

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