Skip to main content
Glama
pebblehost-mcp
by numycode

Edit part of a file

edit_file
Destructive

Replaces exact text in a server file and saves the change, requiring a unique match unless replace_all is set; read the file first.

Instructions

Replaces exact text in a text file and saves it. old_text must match the file exactly, including indentation, and must occur once unless replace_all is set; otherwise nothing is written. Read the file first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "old_text": "<old_text>",
      "new_text": "<new_text>"
    },
    "name": "edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path, relative to the server's root directory, such as "server.properties" or "plugins/LuckPerms/config.yml".
serverNoServer identifier or UUID. Omit to use the configured server (PEBBLEHOST_SERVER_ID); other servers are refused unless PEBBLEHOST_ALLOW_ALL_SERVERS is set.
new_textYesReplacement text.
old_textYesExact text to replace, with enough surrounding lines to be unique.
replace_allNoReplace every occurrence instead of requiring a single one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the destructiveHint/idempotentHint annotations, the description adds genuinely useful behavior: the match is exact including indentation, must be unique unless replace_all is set, and on failure 'nothing is written' — i.e. the write is atomic. It does not cover permissions, encoding, or line-ending normalization, so it stops short of full disclosure.

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?

Three short sentences, front-loaded with the action and followed by the constraints that determine success. Every clause carries information; nothing is padded or restated from the schema.

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 five-parameter mutation tool with annotations but no output schema, the description covers the key risk — a non-unique or non-matching old_text produces no write — plus the read-first prerequisite. Encoding, whitespace/newline sensitivity, and what a successful response returns are left unaddressed.

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 coverage is 100%, so the baseline is 3, but the description earns an upgrade by adding semantics the schema lacks: old_text must match indentation exactly and must be unique unless replace_all is set, with a stated failure consequence. It adds no extra detail for path or server, which the schema already covers well.

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 gives a specific verb and resource — 'replaces exact text in a text file and saves it' — which makes the surgical, in-place nature of the edit clear and implicitly separates it from a whole-file overwrite. It never names a sibling such as write_file, so the differentiation is by mechanism rather than by explicit routing.

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?

'Read the file first' states one required workflow prerequisite, and the uniqueness rule implies when replace_all is appropriate. There is no explicit statement of when to choose this tool over write_file or move_file, so selection guidance remains inferred.

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