Skip to main content
Glama
LMPrado-DZ23

Universal AI Bridge

by LMPrado-DZ23

Editar arquivo (substituição)

edit_file

Replace the first exact occurrence of text in an existing file with new content, with optional regex and replace-all support. Changes require approval before being applied.

Instructions

Substitui a primeira ocorrência exata de old_text por new_text num arquivo existente. Sujeito a aprovação.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
is_regexNoTratar old_text como expressão regular
new_textYesNovo trecho
old_textYesTrecho exato (ou regex, se is_regex) a substituir
replace_allNoSubstituir todas as ocorrências
confirm_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden and does add useful context: it only affects the first exact occurrence, only works on existing files, and is subject to approval. But it omits concrete behavioral details such as what happens when old_text is not found, how approval is granted, or how is_regex and replace_all alter behavior.

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: the first sentence explains the core operation precisely, and the second sentence adds an important approval constraint. Every sentence earns its place with no redundancy.

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?

For a mutable file-editing tool with six parameters, no annotations, and no output schema, this description is too thin. It leaves out guidance on confirm_token, regex mode, replace_all behavior, failure cases, and when to prefer this over write_file, making the definition incomplete for reliable autonomous invocation.

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 67%, and the description clarifies old_text/new_text semantics ('exact first occurrence') and that the target file must already exist. However, it adds nothing about path expectations or confirm_token, which has no schema description, so the parameter guidance is only partially complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Substitui a primeira ocorrência exata de old_text por new_text') on a specific resource ('num arquivo existente'), which is clear and goes well beyond the tool name. It does not explicitly name or contrast sibling tools like write_file, so it slightly misses the top score for sibling differentiation.

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?

Usage context is implied: it edits an existing file rather than creating or moving one, which hints at when to choose it over write_file or move_path. However, it never directly says when to use this tool versus alternatives, nor does it mention situations like regex replacement or bulk replacement that the schema exposes.

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