Skip to content

Class: ToolCallTracker

Makaio Framework


Makaio Framework / ai-adapters-core / ToolCallTracker

Defined in: ../../../adapters/core/src/agent/tool-call-tracker.ts:48

Tracks tool.use → tool.output correlation across adapters.

Different adapters have different correlation capabilities:

  • Claude Code: toolu_* IDs
  • Codex/OpenAI: call_* IDs
  • Others: may have nothing

ToolCallTracker provides a unified interface that:

  1. Uses native IDs when available
  2. Falls back to FIFO by tool name otherwise
  3. Generates UUIDs for adapters without native IDs

new ToolCallTracker(): ToolCallTracker

ToolCallTracker

clear(): void

Defined in: ../../../adapters/core/src/agent/tool-call-tracker.ts:110

Clear all pending entries. Call on turn end to prevent stale entries from leaking across turns.

void


register(toolName, args?, nativeId?): string

Defined in: ../../../adapters/core/src/agent/tool-call-tracker.ts:59

Register a tool.use event. Returns correlation ID to use. If nativeId provided, uses that. Otherwise generates UUID.

string

Name of the tool being invoked

Record<string, unknown>

Tool arguments (optional, for future correlation strategies)

string

Native provider ID if available

string

Correlation ID to use for this tool call


resolve(hints): ResolveResult

Defined in: ../../../adapters/core/src/agent/tool-call-tracker.ts:78

Find correlation ID for a tool output. Tries native ID first, then falls back to FIFO by tool name, and finally to the oldest pending tool call.

ResolveHints

Available hints for correlation

ResolveResult

Correlation result with strategy metadata