Skip to main content
Glama

connect_signal

Add signal connections between nodes in Godot .tscn scene files to enable event-driven communication and game logic.

Instructions

Add a new signal connection between nodes in a .tscn scene file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneYesPath to the .tscn file
sourceYesSource node name (emitter)
signalYesSignal name
targetYesTarget node name (receiver)
methodYesHandler method name on the target
flagsNoConnection flags (default: 0)
expectedHashNoExpected content hash for stale-edit prevention

Implementation Reference

  • The handler function for 'connect_signal' which validates the scene and nodes, checks for duplicates, and appends the new signal connection.
    handler: async (ctx) => {
      const {
        scene: scenePath,
        source: sourceNode,
        signal: signalName,
        target: targetNode,
        method,
        flags = 0,
        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 });
    
          // Validate source and target nodes exist (by node name in connections)
          let sourceExists = false;
          let targetExists = false;
          for (const [, node] of scene.nodes) {
            if (node.name === sourceNode || node.nodePath === sourceNode) sourceExists = true;
            if (node.name === targetNode || node.nodePath === targetNode || targetNode === ".")
              targetExists = true;
          }
    
          if (!sourceExists) {
            return makeTextResponse({
              error: `Source node not found: ${sourceNode}`,
              data: null,
            });
          }
          if (!targetExists) {
            return makeTextResponse({
              error: `Target node not found: ${targetNode}`,
              data: null,
            });
          }
    
          // Check for duplicate
          const duplicate = scene.signalConnections.find(
            (c) =>
              c.signalName === signalName &&
              c.sourceNode === sourceNode &&
              c.targetNode === targetNode &&
              c.targetMethod === method,
          );
          if (duplicate) {
            return makeTextResponse({
              error: "Connection already exists",
              data: null,
            });
          }
    
          scene.signalConnections.push({
            sourceScene: scenePath,
            sourceNode,
            signalName,
            targetNode,
            targetMethod: method,
            targetScript: null,
            targetMethodLine: null,
            connectionFlags: flags,
            rawSpan: null,
          });
    
          await writeAndEmit(scenePath, scene, eventBus, ctx.signal);
    
          return makeTextResponse({
            data: {
              signal: signalName,
              from: sourceNode,
              to: targetNode,
  • The schema defining the input arguments for 'connect_signal', including scene, source node, signal, target node, method, and flags.
    schema: {
      scene: z.string().describe("Path to the .tscn file"),
      source: z.string().describe("Source node name (emitter)"),
      signal: z.string().describe("Signal name"),
      target: z.string().describe("Target node name (receiver)"),
      method: z.string().describe("Handler method name on the target"),
      flags: z.number().optional().default(0).describe("Connection flags (default: 0)"),
      expectedHash: z
        .string()
        .optional()
        .describe("Expected content hash for stale-edit prevention"),
    },
  • The registration entry for the 'connect_signal' tool.
    {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Add a new signal connection' implies a write/mutation operation, it doesn't specify permissions needed, whether the operation is reversible, error conditions, or what happens on success/failure. This leaves significant gaps 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the core functionality.

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 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after connection (e.g., return values, error handling), doesn't mention the sibling 'disconnect_signal' tool, and provides minimal behavioral context despite the complexity.

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 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (like explaining signal/method naming conventions or flag meanings), so it meets the baseline but doesn't provide extra value.

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 ('Add a new signal connection') and the resource ('between nodes in a .tscn scene file'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from the sibling tool 'disconnect_signal' or other signal-related tools, which prevents a perfect score.

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 like 'disconnect_signal' or 'find_signal_connections', nor does it mention prerequisites or context for when signal connections are appropriate. It simply states what the tool does without usage context.

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