Skip to main content
Glama

Script Create

script_create

Create or overwrite GDScript or C# files in a Godot project, register them with the editor, and validate GDScript syntax. C# scripts are saved as text for compilation in the editor.

Instructions

Create a script file on disk: GDScript (.gd, validated) or C# (.cs, text only).

Writes content to the path. Overwrites if it exists. Registers the file with the editor. New files include data.cleanup.rm listing the file and, when supported by the editor, its .uid sidecar; overwrite omits it.

.gd: source is parse-validated and the response carries diagnostics (diagnostics_status="checked"); an already-loaded script is refreshed in place. .cs: written as text only — Godot AI does not compile .NET, so diagnostics_status="not_checked" and validation_hint says to build the project (editor Build button or dotnet build) to see compiler errors. dotnet_editor reports whether the connected editor build has .NET at all. Any other extension is rejected; use filesystem_manage op="write_text".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesres:// path ending in .gd or .cs (e.g. "res://scripts/player.gd").
contentNoGDScript or C# source. Empty creates a blank file.
session_idNoOptional Godot session to target. Empty = active session.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.2.1
    • changedInput schema / properties / content / description
      Previous value: -"GDScript source. Empty creates a blank file."New value: +"GDScript or C# source. Empty creates a blank file."
    • changedInput schema / properties / path / description
      Previous value: -"res:// path (e.g. \"res://scripts/player.gd\")."New value: +"res:// path ending in .gd or .cs (e.g. \"res://scripts/player.gd\")."
  2. Addedv3.1.4
  3. Removedv3.0.7
  4. First observedv2.9.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so excellently: it discloses overwrite behavior, editor registration, the data.cleanup.rm sidecar difference for new vs overwritten files, .gd parse validation and in-place refresh, .cs non-compilation with diagnostics_status='not_checked', and the dotnet_editor capability check. This is a thorough behavioral 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?

The description is dense but every sentence earns its place: scoping, side effects, per-extension behavior, diagnostics, and fallback routing. It is well-structured with a clear summary up front followed by relevant details, avoiding fluff while covering critical edge cases.

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?

The tool has enough complexity that a brief description would be inadequate, but this one covers all decision-relevant aspects: accepted extensions, overwrite semantics, cleanup metadata, validation differences, diagnostics, and the alternative for non-script writes. An output schema exists, so return-value documentation is not the description's job, and nothing essential is missing.

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 adds meaningful semantics: path extension determines validation behavior, content is parsed for .gd but stored as text for .cs, and empty content creates a blank file. It does not add much about session_id beyond the schema, but the extension-specific behavior enriches the path and content parameters.

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 opens with a specific verb and resource: 'Create a script file on disk' and explicitly scopes to GDScript or C#, distinguishing it from generic file writes. It clearly differentiates from relevant siblings like script_patch, script_attach, and script_manage by emphasizing creation and on-disk registration.

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

Usage Guidelines4/5

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

The description gives clear context for when to use the tool (creating .gd/.cs scripts) and explicitly routes unsupported extensions to filesystem_manage op='write_text'. It does not explicitly contrast with script_patch or script_manage, but the creation-focused wording and overwrite semantics imply the boundary.

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