Skip to main content
Glama

add_variable

Add a top-level variable or property declaration to a GDScript file in Godot 4 projects, supporting type hints, default values, and editor visibility options.

Instructions

Add a top-level variable or property declaration to a GDScript file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesAbsolute path to the project directory
scriptPathYesScript path (res:// or relative to project)
varNameYesVariable name (valid GDScript identifier)
typeNoOptional type hint, e.g. "float", "String", "Node2D"
defaultValNoOptional default value expression, e.g. "300.0" or "Vector2.ZERO"
exportedNoIf true, adds @export annotation (makes variable visible in the editor)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool adds a variable but doesn't disclose behavioral traits like whether it overwrites existing variables, requires specific permissions, handles errors, or modifies files in-place. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, clear sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it efficient and easy to parse.

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

Completeness2/5

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

Given this is a mutation tool (adding variables) with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like side effects, error handling, or return values, which are critical for safe and effective use. The schema handles parameters well, but the overall context lacks depth.

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 the schema already documents all 6 parameters thoroughly. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain interactions between parameters like how 'exported' affects 'type'). Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the action ('Add'), the resource ('top-level variable or property declaration'), and the target ('to a GDScript file'). It specifically distinguishes this from sibling tools like add_script_function or add_signal by focusing on variable declarations rather than functions or signals.

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 description implies usage for adding variables to GDScript files but doesn't explicitly state when to use this versus alternatives like modify_script (which might handle broader edits) or when not to use it (e.g., for non-GDScript files). It provides basic context but lacks explicit guidance on alternatives or exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pushks18/Godot-MCP-Pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server