Trace connection function
trace-connection-functionInspect a connection on an Instance's RBXScriptSignal to return debug metadata about the connected Luau function, including name, source, line, and parameter count.
Instructions
Inspect a single connection on an Instance's RBXScriptSignal and return debug metadata about the connected Luau function. Uses getconnections(inst[signalName]) to enumerate connections and debug.info/debug.getinfo to resolve the function's name, source, line and parameter count. REQUIRES an executor exposing getconnections and debug.info (or debug.getinfo); if either capability is missing, or the signal/connection/function cannot be resolved, returns a clear { error } describing the missing capability. Returns { Signal, ConnectionIndex, ConnectionCount, Function: { Name, Source, ShortSource, LineDefined, NumParams, IsVararg, What, Pointer } }. Signature: { instancePath: string, signalName: string, connectionIndex: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. Capabilities: getconnections. Produces: bounded-event-snapshot, created-handle. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signalName | Yes | Name of the RBXScriptSignal member on the instance to inspect, e.g. 'Touched', 'Changed', 'OnClientEvent'. | |
| instancePath | Yes | Lua expression resolving to the target Instance, e.g. 'game.Players.LocalPlayer.Character.Humanoid'. Evaluated as `return <instancePath>`. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. | |
| connectionIndex | No | Zero-based index of the connection to trace within getconnections() results (default: 0 = first connection). |