Skip to main content
Glama

script_patch

Patch a Godot .gd file by replacing an exact substring with new text. Requires a unique match unless replace_all=True; fails on 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

Behavior5/5

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

With no annotations provided, the description carries full responsibility for disclosing behavior, and it excels. It states failure conditions ('Fails on multiple matches unless replace_all=True; fails on zero matches'), exact matching semantics ('Exact byte match (whitespace significant)'), side effects ('Triggers filesystem scan'), and undo limitations ('Not undoable via Ctrl+Z'). This is comprehensive and transparent.

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-organized. Each sentence delivers essential information: first the overall purpose, then the matching behavior, failure modes, exactness, and side effects. No fluff or redundancy; it earns a perfect score for structure.

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?

For a tool with 5 parameters, no annotations, and an output schema, the description covers all necessary operational aspects: exact replacement behavior, failure conditions, replace_all option, side effects, and undoability. It does not need to describe return values because an output schema exists. It is fully complete given the tool's complexity.

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 a baseline of 3 applies. The description adds value by clarifying the matching semantics ('Exact byte match (whitespace significant)') and reinforcing the uniqueness of old_text unless replace_all. This goes beyond the schema's 'Exact substring' phrasing, thus warranting a 4.

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: 'Anchor-based string-replace edit on a .gd file.' This clearly distinguishes it from sibling tools like script_create or script_manage by specifying the exact operation (string replacement) and the target file type. The behavior is unambiguous and sets expectations precisely.

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 provides strong context for when to use the tool: for exact, controlled string-replacements on .gd files, with explicit notes about failure on multiple/zero matches and the replace_all option. It does not explicitly name alternatives or state 'when-not-to-use,' but the clarity of behavior implies appropriate usage, so it earns a 4 rather than a 5.

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