Skip to main content
Glama

add_script_function

Append a function to a GDScript file by providing the script path, function name, parameters, body, and optional return type. Enables programmatic script modification in Godot Engine projects.

Instructions

Append a function to GDScript.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoFunction bodypass
pathYesPath to .gd script file
paramsNoParameter names (e.g. ["delta: float"])
func_nameYesFunction name
after_funcNoInsert after this function
return_typeNoReturn type hint
Behavior2/5

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

With no annotations provided, the description must fully disclose behavior. It states only that the tool appends a function, but does not reveal that this modifies the file on disk, whether it checks for duplicate function names, how insertion order works, or any side effects. The 'append' wording implies mutation, but without safety or side-effect details, the description falls short for a mutation tool.

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?

The description is a single concise sentence with no redundant words. It is front-loaded with the core action, but it is arguably too terse for a tool with six parameters. However, conciseness is not penalized heavily because it is efficient; the lack of detail is addressed in other dimensions.

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 the tool has six parameters, no output schema, and no annotations, the single-sentence description is insufficient. It does not explain the return value, file modification behavior, interaction with the 'after_func' parameter, or how it relates to sibling tools like validate_script or write_script. The description leaves significant gaps for complex tool usage.

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 all six parameters have descriptive text in the schema. The tool description itself adds no parameter information, but since the schema already documents each parameter (e.g., path, func_name, body), the baseline of 3 is appropriate. The description does not compensate or add extra meaning beyond the schema.

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 'Append a function to GDScript' uses a specific verb ('Append') and identifies the resource ('function to GDScript'). It clearly indicates the tool's core action, distinguishing it from related tools like add_script_signal or add_script_export, though it does not explicitly name these alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as create_script, write_script, or add_script_export. It lacks context about prerequisites, such as the script file existing or the function not already being present, and offers no 'when to use' or 'when not to use' information.

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/yanhuifair/Godot-MCP'

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