Skip to main content
Glama

disconnect_signal

Remove signal connections from Godot scene files to manage event handling and clean up node interactions in game development projects.

Instructions

Remove a signal connection from a .tscn scene file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneYesPath to the .tscn file
sourceYesSource node name
signalYesSignal name
targetYesTarget node name
methodYesHandler method name
expectedHashNoExpected content hash for stale-edit prevention

Implementation Reference

  • The implementation of the disconnect_signal tool, which includes schema definition, parsing, logic to find and remove a signal connection from a Godot .tscn file, and error handling.
    {
      name: "disconnect_signal",
      description: "Remove a signal connection from a .tscn scene file.",
      schema: {
        scene: z.string().describe("Path to the .tscn file"),
        source: z.string().describe("Source node name"),
        signal: z.string().describe("Signal name"),
        target: z.string().describe("Target node name"),
        method: z.string().describe("Handler method name"),
        expectedHash: z
          .string()
          .optional()
          .describe("Expected content hash for stale-edit prevention"),
      },
      handler: async (ctx) => {
        const {
          scene: scenePath,
          source: sourceNode,
          signal: signalName,
          target: targetNode,
          method,
          expectedHash,
        } = ctx.args;
        validatePath(scenePath);
    
        return withFileLock(scenePath, async () => {
          try {
            const { source, scene } = await readAndParse(scenePath);
            const hashErr = hashCheck(source, expectedHash);
            if (hashErr) return makeTextResponse({ error: hashErr, data: null });
    
            const idx = scene.signalConnections.findIndex(
              (c) =>
                c.signalName === signalName &&
                c.sourceNode === sourceNode &&
                c.targetNode === targetNode &&
                c.targetMethod === method,
            );
    
            if (idx === -1) {
              return makeTextResponse({
                error: `Connection not found: ${signalName} from ${sourceNode} to ${targetNode}::${method}`,
                data: null,
              });
            }
    
            scene.signalConnections.splice(idx, 1);
    
            await writeAndEmit(scenePath, scene, eventBus, ctx.signal);
    
            return makeTextResponse({
              data: {
                removed: {
                  signal: signalName,
                  from: sourceNode,
                  to: targetNode,
                  method,
                },
              },
              metadata: { source: "index" },
            });
          } catch (err) {
            return makeTextResponse({
              error: `Failed to disconnect signal: ${(err as Error).message}`,
              data: null,
            });
          }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It states the tool performs a removal operation but doesn't clarify if this is destructive, requires specific permissions, or has side effects (e.g., breaking scene functionality). No rate limits, error conditions, or output behavior are mentioned, leaving significant gaps.

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, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. No unnecessary words or redundant information.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after removal (e.g., success confirmation, error handling), potential impacts on the scene, or how to verify the change. Given the complexity of modifying scene files, more context is needed.

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 parameters are fully documented in the schema. The description adds no additional semantic context about parameters beyond implying they identify a signal connection. Baseline score of 3 is appropriate as the schema does the heavy lifting.

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 clearly states the action ('Remove') and resource ('a signal connection from a .tscn scene file'), making the purpose evident. It doesn't explicitly differentiate from sibling tools like 'remove_node' or 'remove_from_group', but the specificity of 'signal connection' provides some implicit distinction.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, when not to use it, or related tools like 'connect_signal' or 'find_signal_connections' from the sibling list. Usage context is implied but not explicit.

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/woohq/godette-mcp'

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