Skip to main content
Glama

find_signal_connections

Locate signal connections for specific nodes in Godot scenes or search for signal usage across entire projects to understand event-driven workflows.

Instructions

Find all signal connections for a node in a scene, or all connections for a signal name across the project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sceneNoPath to the .tscn file
nodeNoNode name to find connections for
signalNoSignal name to search across all scenes

Implementation Reference

  • The handler function that executes the 'find_signal_connections' logic, querying an index for signals or node connections.
    handler: async (ctx) => {
      const { scene, node, signal } = ctx.args;
      if (scene) validatePath(scene);
    
      let results: SignalConnectionResult[] = [];
    
      if (signal) {
        const entries = await index.findSignalByName(signal);
        results = entries.map((e) => ({
          signalName: e.connection.signalName,
          sourceNode: e.connection.sourceNode,
          targetNode: e.connection.targetNode,
          targetMethod: e.connection.targetMethod,
          scenePath: e.scenePath,
        }));
      } else if (scene && node) {
        const sources = await index.getSignalConnections(scene, node);
        const targets = await index.getSignalListeners(scene, node);
        results = [
          ...sources.map((e) => ({
            direction: "emits" as const,
            signalName: e.connection.signalName,
            targetNode: e.connection.targetNode,
            targetMethod: e.connection.targetMethod,
          })),
          ...targets.map((e) => ({
            direction: "receives" as const,
            signalName: e.connection.signalName,
            sourceNode: e.connection.sourceNode,
            targetMethod: e.connection.targetMethod,
          })),
        ];
      }
    
      // Include declarations if searching by signal name
      let declarations: SignalDeclarationResult[] = [];
      if (signal) {
        declarations = (await index.getSignalDeclarations(signal)).map((d) => ({
          name: d.name,
          parameters: d.parameters,
          scriptPath: d.scriptPath,
          line: d.line,
        }));
      }
    
      return makeTextResponse({
        data: { connections: results, declarations },
        totalCount: results.length,
        metadata: { source: "index" },
      });
    },
  • The registration and schema definition for the 'find_signal_connections' tool within 'scene-tools.ts'.
    {
      name: "find_signal_connections",
      description: {
        base: "Find all signal connections for a node in a scene, or all connections for a signal name across the project.",
        slots: {
          planning: "Use this BEFORE editing signals to understand existing connection flow.",
          debugging: "Start here to trace signal-related bugs.",
          editing: "Verify connections after making signal changes.",
        },
      },
      schema: {
        scene: z.string().optional().describe("Path to the .tscn file"),
        node: z.string().optional().describe("Node name to find connections for"),
        signal: z.string().optional().describe("Signal name to search across all scenes"),
      },

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