Skip to main content
Glama
abnersajr
by abnersajr

read_edit

Read a file and optionally edit it in a single call, reducing tool calls for single-file tasks. Omit edit parameters for read-only.

Instructions

Read a file and optionally edit it in one call. For single-file tasks, use this instead of separate read_file + edit calls. Returns file content. Edit params (old_string, new_string) are optional — omit them for read-only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the file
old_stringNoText to replace (exact match or regex if use_regex=true)
new_stringNoText to replace with
use_regexNoTreat old_string as regex (default: false)
replace_allNoReplace all occurrences (default: false)
offsetNoLine number to start reading from (optional)
limitNoNumber of lines to read (optional)
Behavior3/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 explains that the tool can read or edit, and that edit params are optional for read-only use. However, it lacks details on mutation effects (e.g., whether edits are permanent, required permissions, error handling on edit failure), leaving important behavioral aspects undisclosed.

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 extremely concise, consisting of only two sentences that are front-loaded with the core purpose. Every sentence adds unique value without redundancy, making it efficient for an AI agent to parse quickly.

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?

Given the tool's complexity (7 parameters, combination of read and edit operations) and the absence of an output schema, the description is moderately complete. It states that it 'Returns file content' but does not specify the format or behavior when editing fails. More details on error states or return structure would enhance completeness for reliable tool 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?

All 7 parameters are fully described in the input schema (100% coverage), so the schema already provides clear semantics. The description adds minimal value by clarifying that old_string and new_string are optional and can be omitted for read-only behavior, which is already implied by the schema's 'required' field. This slight addition does not significantly elevate understanding beyond the schema.

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 tool reads and optionally edits a file in one call, using a specific verb ('Read') and resource ('file'). It distinguishes itself from sibling tools like multi_edit by specifying 'single-file tasks', providing clear differentiation.

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 explicitly advises using this tool for single-file tasks instead of separate read_file and edit calls, offering clear when-to-use guidance. This effectively sets usage context and implies alternatives, making it easy for an AI agent to decide when to select this tool over others.

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/abnersajr/mcp-readedit'

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