Skip to main content
Glama

script_patch

Replace an exact substring in a .gd script with a new string. Replaces all occurrences if replace_all is true; otherwise fails on multiple or zero matches.

Instructions

Anchor-based string-replace edit on a .gd file.

Finds an exact old_text and replaces with new_text. Fails on multiple matches unless replace_all=True; fails on zero matches. Exact byte match (whitespace significant). Triggers filesystem scan. Not undoable via Ctrl+Z.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesres:// path ending in .gd.
new_textYesReplacement (empty deletes).
old_textYesExact substring to find. Must be unique unless replace_all.
session_idNoOptional Godot session to target. Empty = active session.
replace_allNoReplace every occurrence. Default False.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations provided, but the description effectively discloses important behaviors: exact byte match (whitespace significant), triggers filesystem scan, and is not undoable via Ctrl+Z. It does not detail permissions or potential destructive effects beyond the edit, but the presence of an output schema reduces the need to explain return values.

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 concise and well-structured, with the main purpose front-loaded followed by key details. Every sentence adds value, resulting in no wasted words.

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?

Given the complexity of 5 parameters and the presence of an output schema, the description covers the main behaviors and side effects. However, it could be slightly more complete by clarifying the exact nature of the 'filesystem scan' or potential cost, but overall it is adequate.

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 description coverage is 100%, so baseline is 3. The description adds meaning beyond the schema by explaining that old_text must be unique unless replace_all is true, new_text can be empty to delete, and replace_all replaces every occurrence. This clarifies usage beyond the schema's property descriptions.

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 it performs an 'anchor-based string-replace edit on a .gd file' using specified old_text and new_text. It distinguishes itself from sibling tools like script_create or script_manage by focusing on editing existing scripts via string replacement.

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 modifying .gd files but does not explicitly state when to use this tool versus alternatives. It mentions failure conditions (multiple matches unless replace_all=True, zero matches) but provides no comparison to sibling tools or guidance on when not to use.

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/hi-godot/godot-ai'

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