Skip to main content
Glama
Airgap-fleet

file-bridge

by Airgap-fleet

patch_file

Replace exact text occurrences in a file with new content using atomic writes. Returns the number of replacements made.

Instructions

Apply a targeted patch to a file.

Finds all occurrences of old_str and replaces them with new_str. Uses atomic write. Returns the number of replacements made.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYesRequest model for patch_file tool.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe path that was patched.
new_sizeYesFile size after patch in bytes.
old_sizeYesFile size before patch in bytes.
replacementsYesNumber of replacements made.

Schema Changelog

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

  1. First observedv1.0.4

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It proactively discloses three important traits: all occurrences are replaced, the operation uses atomic write, and the tool returns the number of replacements made. It does not spell out no-match or file-not-found behavior, but the core side effects and return signal are covered.

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 three short sentences, front-loaded with the core action followed by the behavioral guarantee and return value. There is no redundancy or filler.

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 mutation tool with no annotations, the description covers the main behavioral contract and return semantics, and the input schema supplies the nested request fields and encoding default. The main gaps are explicit failure modes and when-not-to-use guidance, which are useful but not critical for invoking the tool.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds value by explaining that the patch targets every occurrence of old_str, not just the first one, which is a semantic guarantee not explicit in the schema. Path and encoding are already fully described in 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 begins with 'Apply a targeted patch to a file,' identifying a specific verb, target, and scope. It further defines the behavior as replacing all occurrences of old_str with new_str, which clearly distinguishes it from write_file (full-file overwrite) and read_file.

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?

The usage context is implied by the phrase 'targeted patch' and the find/replace semantics, but the description never explicitly says when to prefer patch_file over write_file or states any exclusions. An agent can infer the use case, but the guidance is not explicit.

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/Airgap-fleet/file-bridge'

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