Skip to main content
Glama
devrandom

mcp-fstools

by devrandom

edit

Replace a unique substring in a file with new text, requiring a prior read and returning a unified diff.

Instructions

Replace old_string with new_string in file_path.

Requirements (matches opencode):

  • You must call read on this file in the same session first.

  • old_string must appear exactly once in the current file content. Provide more surrounding context if it isn't unique.

  • The file must not have changed since the last read.

Returns a unified diff of the change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYes
newStringYes
oldStringYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses all behavioral traits: requirements to read first, uniqueness constraint, no changes since read, and return type (unified diff). This is thorough and transparent.

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 concise with a clear structure: a single sentence explaining the action, followed by bullet-pointed requirements and a return statement. Every sentence adds value.

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

Completeness4/5

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

For a file editing tool with 3 parameters, no annotations, but an output schema, the description covers prerequisites, behavior, and return value. It is fairly complete, though it could elaborate on edge cases.

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

Parameters2/5

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

Schema description coverage is 0%, but the description does not add much meaning beyond the parameter names used in context. It explains usage but not parameter semantics like types or formats.

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 verb 'Replace' and the resource 'string in file_path', and mentions it returns a unified diff. It distinguishes from sibling tools 'read' and 'write' which have different operations.

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

Usage Guidelines4/5

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

The description specifies prerequisites: must have read the file, old_string must appear exactly once, and file must not have changed. It provides clear conditions for use, though it does not explicitly contrast with sibling tools like 'write'.

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/devrandom/mcp-fstools'

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