Skip to main content
Glama

Script / Update

script-update
DestructiveIdempotent

Overwrites an existing Godot C# or GDScript file under res:// with new source, validates GDScript before writing, and leaves invalid files untouched. Fails if the path is missing.

Instructions

Overwrite an EXISTING Godot script file (C# '.cs' or GDScript '.gd') under res:// with the provided source. Fails if no file exists at the path — use 'script-create' to create one. GDScript content is syntax-validated before write (invalid '.gd' is rejected and the existing file is left untouched); C# is accepted as-is (no in-editor compiler) and the post-write build settle surfaces compile errors. For a '.cs' file the editor filesystem reimports and BOUNDED-settles before returning (then 'script-build' loads the changed type); a '.gd' file only needs a filesystem update so the editor re-parses it. Use 'script-read' to inspect the current content first. Returns a structured ScriptInfo.

Input Schema

NameRequiredDescriptionDefault
contentYesNew source code to write (replaces the file's entire content).
scriptPathYesres:// path of the existing script to overwrite, ending in '.cs' or '.gd'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.35.1

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that GDScript is syntax-validated and rejected without touching the existing file, C# is written as-is with no in-editor compile, that a bounded reimport/settle occurs for .cs, and that compile errors surface post-write. Failure behavior and side effects are described in concrete terms consistent with destructiveHint=true.

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?

Front-loads the operation and scoping, then layers validation and follow-up behavior; nearly every clause carries information. It is dense and somewhat parenthetical ('BOUNDED-settles', capitalized emphasis), which costs a little readability but not correctness.

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 2-parameter mutation with no output schema, it covers failure modes, validation, and follow-up steps thoroughly. The one gap is the return value: it only says "Returns a structured ScriptInfo" without any indication of what that structure contains, and there is no output schema to fall back on.

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 description coverage is 100%, so both parameters are already documented (full-content replacement, res:// path ending in .cs or .gd). The description mostly restates those constraints rather than adding new syntax or format guidance, so the baseline 3 applies.

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?

"Overwrite an EXISTING Godot script file ... under res:// with the provided source" gives a specific verb, resource, and scope, plus the accepted extensions. It explicitly names the sibling tools script-create, script-read, and script-build, so an agent can distinguish the intended tool without opening schemas.

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?

States the preconditions (a file must already exist at the path), tells what to do otherwise (use 'script-create'), recommends inspecting first with 'script-read', and names the follow-up tool 'script-build' for C# types. Explicit when/when-not plus alternatives.

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