Skip to main content
Glama
Beckett — MCP for Godot

Beckett — MCP for Godot

by beckettlab

script_patch

Destructive

Surgically edit an existing res:// file without rewriting it whole; apply ordered find/replace, append, or prepend edits, writing only when anchors match and GDScript compiles.

Instructions

Surgically edit an existing res:// file without rewriting it whole. edits = an ordered array; each item is {find, replace[, all]} (find must match EXACTLY once unless all:true), {append: text}, or {prepend: text}. Atomic + safe: nothing is written if any anchor is missing/ambiguous or (for .gd) the result fails to compile. Reads the file back (disk_verified). Prefer this over write_script for small changes.

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>",
      "edits": "<edits>"
    },
    "name": "script_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesres:// path to an existing file
editsYes[{find, replace, all?} | {append} | {prepend}] applied in order
validateNocompile-check the result before writing (default true, .gd only)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.12.1
  2. Removedv1.10.0
  3. First observedv1.0.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: it discloses atomicity ('nothing is written if any anchor is missing/ambiguous'), an implicit compile gate for .gd files, and post-write verification ('reads the file back (disk_verified)'). These are exactly the failure-mode and safety details an agent needs before invoking a destructive mutation.

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?

Front-loaded with the purpose, then the edit grammar, then safety semantics, then sibling routing. Four dense sentences with no filler and no repetition of schema-declared field types.

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

Completeness5/5

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

No output schema exists, and the description compensates by stating the return-relevant behavior ('reads the file back (disk_verified)') plus the validation default for .gd compile checks. For a destructive three-parameter mutation tool, nothing material about invocation or outcome is left unstated.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds substantial meaning beyond the schema: the three edit item forms ({find,replace,all}, {append}, {prepend}), ordered application, and the critical uniqueness rule ('find must match EXACTLY once unless all:true'). That uniqueness constraint is the main way this call fails and the schema does not express it.

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?

States a specific verb and resource ('surgically edit an existing res:// file without rewriting it whole') and immediately distinguishes itself from the whole-file writer sibling write_script. An agent can tell exactly which class of operation this performs without opening the schema.

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

Usage Guidelines5/5

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

The closing sentence explicitly routes the agent: 'Prefer this over write_script for small changes,' naming the alternative and the condition that selects it. Combined with the opening scope statement (existing file, surgical edits), the when-to-use boundary is unambiguous.

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