Skip to main content
Glama

host_file_edit

Edit fleet registry files on a host: clone a template node's entry for a new node, or remove a deleted node's entries. Dry-run shows the diff before backup and safe in-place write.

Instructions

Edit one of the fleet's registry files on a host the way it is done by hand: clone the entry of a template node for a new node (Prometheus overrides, log-collector inventory, reboot-reminder lists, IP lists) or remove the entries of a removed node (e.g. node_servers.keep.txt). Works on plain lines (an IP inside a one-line list is edited in place), JSON and YAML (comments kept). The dry run shows the diff; the file is backed up (.bak-mia-), written in place (owner and mode kept), optionally a unit is reloaded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesclone — добавить копию записи; replace — поменять в самой записи; remove — убрать запись
hostYes
pathYes
applyNofalse (default) = dry run: show what will happen on which hosts and a planHash. true = run it; needs planHash
matchYestext that identifies the entry (template node name / address, or the removed node)
formatNoauto
reloadNounit to reload (or restart when it cannot reload) afterwards
replaceNoclone: text replacements, e.g. {"node-pl2":"node-pl3","pl2":"pl3"}
planHashNoplanHash from the dry run of the very same call, good for one apply; refused if targets or their state changed since

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does it well: it discloses the dry-run default, the diff preview, the backup file naming (.bak-mia-<time>), in-place writing with owner and mode preserved, and the optional unit reload. It stops short of stating permission requirements or failure modes, but this is rich disclosure for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and the two primary operations are front-loaded in the first sentence, with behavioral details following. It is dense but every sentence carries information; the only minor cost is the parenthetical example lists, which lengthen the opening without much added routing 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?

No output schema exists, but the description covers the key lifecycle facts an agent needs: dry run returns a diff and planHash, apply requires that planHash, the file is backed up and written in place with permissions preserved, and a unit can be reloaded. Missing permission/auth requirements and the exact refusal condition (targets changed) is covered only via the schema, leaving a small gap for a destructive 9-parameter tool.

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 67%, so several parameters (apply, match, reload, replace, planHash) are already documented in the schema. The description adds contextual meaning for op (clone/replace/remove) and format (plain lines, JSON, YAML with comments kept), but leaves host and path unexplained, so it only partially compensates for the coverage gap.

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?

States a specific verb (edit) and resource (fleet registry files on a host) and grounds it with concrete examples: cloning a template node's entry for a new node, or removing a removed node's entries (node_servers.keep.txt). This is enough to separate it from host_file_read (read) and fleet_host_edit (host config), though neither sibling is named explicitly.

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 two headline scenarios (clone for a new node, remove for a removed node) implicitly tell the agent when to reach for it, and the op enum is echoed contextually. However, there is no explicit when-not-to-use guidance and no pointer to alternatives such as host_file_read for inspection, so usage is implied rather than stated.

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