Skip to main content
Glama

edit_block

Replace the Nth occurrence of a target text string in a file with your replacement, allowing precise edits when the same text appears multiple times.

Instructions

Replace the Nth occurrence of text in a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
targetYes
occurrenceNo
replacementYes
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does not specify behavior when the target text is absent, when fewer occurrences exist, or whether the replacement is exact-match. No error handling or side effects are mentioned, leaving significant ambiguity for a mutation tool.

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 a single sentence that directly states the tool's purpose without any filler. It is front-loaded and every word earns its place.

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?

The tool has four parameters, no annotations, and no output schema. The description is too brief to cover important operational context such as error behavior, occurrence counting (e.g., 0- or 1-based), or how it differs from similar editing tools. This is minimal for an editing tool with multiple potential edge cases.

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 description coverage is 0%, so the description should add meaning to the parameters. It clarifies the 'Nth occurrence' concept, which maps to the 'occurrence' field, and implies that 'target' is the text to find and 'replacement' is the new text. However, it does not explicitly name parameters or explain edge cases like exact matching or regex support, so it only partially compensates for the lack of 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 uses a specific verb ('Replace') and clearly identifies the resource ('the Nth occurrence of text in a file'). It distinguishes this from whole-file writes (write_file) or other editing operations by emphasizing the occurrence-based replacement, which sets it apart from sibling tools.

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 is provided on when to use this tool versus alternatives like write_file or apply_workspace_edit. The description implies a use case but gives no explicit context, prerequisites, or exclusions.

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/PushPullCommitPush/GPT-Commander---An-LLM-facing-software-engineering-substrate'

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