Skip to content

ToolCallCollectorHolder

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Diagnostics

ToolCallCollectorHolder Class

DI-registered singleton that holds the IToolCallCollector instance. The diagnostics middleware sets the real collector during factory construction; consumers resolve this to access it. Unlike a static holder, each DI container has its own instance, making it testable and thread-safe across containers.

public sealed class ToolCallCollectorHolder : NexusLabs.Needlr.AgentFramework.Diagnostics.IToolCallCollector

Inheritance System.Object 🡒 ToolCallCollectorHolder

Implements IToolCallCollector

Methods

ToolCallCollectorHolder.DrainToolCalls() Method

Drains all captured tool calls since the last drain. Thread-safe. Returns an empty list if no tool calls have been recorded.

public System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.AgentFramework.Diagnostics.ToolCallDiagnostics> DrainToolCalls();

Implements DrainToolCalls()

Returns

System.Collections.Generic.IReadOnlyList<ToolCallDiagnostics>