Skip to main content
Glama

edit_file

Destructive

Perform a single, exact search-and-replace in a file, then commit and push changes immediately.

Instructions

Surgical search-and-replace edit in a file. old_string must match exactly once. Commits and pushes immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
new_stringYesReplacement text
old_stringYesExact text to find
project_idYesTypleaf project ID — a 24-character lowercase hex string (e.g. '692a83fb82feceb233c4b0e7'), obtained from list_projects or the project URL. NOT a local filesystem path, NOT '.', NOT a project name or title. These tools operate on the REMOTE Typleaf project. Only call these tools when the user explicitly asks to work with a Typleaf project — never for general local file I/O. If you already have a copy of THIS project checked out on the local filesystem, prefer the standard read/grep tools against that path. Always call list_projects first when unsure.
commit_messageNo
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, indicating a write and potentially destructive operation. The description adds the important side effect 'Commits and pushes immediately' and the constraint that old_string must match exactly once, which are valuable beyond annotations. However, it does not disclose error handling (e.g., multiple matches) or whether the file must exist, so transparency is adequate but incomplete.

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?

Two sentences with no wasted words. The core function 'Surgical search-and-replace edit' is front-loaded, followed by the critical uniqueness constraint and immediate commit/push side effect. Every sentence earns its place, making it highly concise and well-structured.

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 omits any mention of return values or errors (e.g., what happens if old_string is not found or matches multiple times). Given the destructiveHint and lack of output schema, an agent might benefit from knowing failure modes. However, the commit/push behavior and uniqueness constraint are covered, and the project_id schema description provides remote-project context, so completeness is moderate.

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 60% with project_id having a detailed description. The description adds semantic value by stating that old_string must match exactly once, which is more specific than the schema's 'Exact text to find'. It does not clarify commit_message or other parameters, but the primary constraint is useful. Since schema partially covers parameters, the score is moderate.

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 clearly identifies the action as a surgical search-and-replace edit on a file, which distinguishes it from broader operations like rewrite_file or create_file. However, it does not explicitly name alternative sibling tools, so it lacks overt differentiation despite the clarity of the core function.

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?

There is no guidance on when to use this tool versus alternatives like rewrite_file or update_section. The description notes that it commits and pushes immediately, which is a behavior, not a usage guideline. It does not specify preferred scenarios or exclusions, leaving the agent to infer suitability.

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/superzeldalink/typleaf-mcp'

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