Skip to main content
Glama

file_patch

Replace a unique text block in a project file with new content, failing safely if the match is missing or ambiguous.

Instructions

Replace exactly one matching text block in a UTF-8 project file. Fails when the match is missing or ambiguous.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
newTextYes
oldTextYes
projectIdYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0-alpha.1

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the matching behavior, the failure conditions for missing or ambiguous matches, and UTF-8 encoding. However, it does not mention side effects beyond replacement, such as whether the file is modified in place, whether permissions are needed, or what happens on success.

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, tightly packed sentence with no filler. It front-loads the core operation and includes the most important constraints and failure behavior efficiently.

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 is adequate for basic selection and invocation, but with no output schema and no annotations, an agent still lacks information about return values, whether oldText must be unique or can be a substring, and what constitutes success. The failure cases are covered, but the overall operational context is incomplete for a mutating tool.

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%, so the description must compensate for the four parameters. It partially clarifies oldText/newText via 'matching text block' and 'Replace', but it does not explain projectId or path meaning, path scope, or the relationship between the parameters beyond the basic replace concept.

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 states a specific action ('Replace'), a specific resource ('one matching text block in a UTF-8 project file'), and adds distinguishing constraints ('exactly one', fails on missing/ambiguous matches). This clearly differentiates file_patch from file_write and file_read.

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 clearly implies when to use this tool: when an exact, unique text replacement is needed in a project file. It does not explicitly name alternatives such as file_write for whole-file writes, but the 'exactly one matching text block' phrasing gives clear contextual guidance and the failure conditions reinforce the intended use.

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

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/KatoteshiKuka/forgeguard-mcp'

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