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
| Name | Required | Description | Default |
|---|---|---|---|
| scene | No | Path to the .tscn file | |
| node | No | Node name to find connections for | |
| signal | No | Signal name to search across all scenes |
Implementation Reference
- src/tools/scene-tools.ts:223-273 (handler)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" }, }); }, - src/tools/scene-tools.ts:208-222 (registration)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"), },