Skip to main content

Interface: ToolExecutionContext

Defined in: packages/agentos/src/core/tools/ITool.ts:137

Defines the invocation context passed to a tool's execute method. This context provides the tool with essential information about the calling entity (GMI, Persona), the user, and the overall session, enabling context-aware tool execution.

Interface​

ToolExecutionContext

Properties​

callerTurn?​

optional callerTurn: CallerTurnContext

Defined in: packages/agentos/src/core/tools/ITool.ts:167

Live objects of the turn that made the call: its approval gate, its budget, its explicit user, a seat's tool names and hooks, the processToolCall of the view the call came through (dispatch) and the output guardrails' tool-call gate the turn asks (toolCallGate). Set by gmi()'s tool hook, by a runtime seat's view, and by a GMI whose turn asks such a gate; the step gate runs each step of a composed tool through dispatch.


correlationId?​

optional correlationId: string

Defined in: packages/agentos/src/core/tools/ITool.ts:141

An optional identifier used to correlate this specific tool call with other operations, logs, or events across different parts of the system. Useful for tracing and debugging.


gmiId​

gmiId: string

Defined in: packages/agentos/src/core/tools/ITool.ts:138

The unique identifier of the GMI (Generalized Mind Instance) that is invoking the tool.


personaCapabilities?​

optional personaCapabilities: string[]

Defined in: packages/agentos/src/core/tools/ITool.ts:148

The calling persona's capabilities, as the permission check received them. A tool that runs other tools on the caller's behalf (a composed tool, a workflow) passes them on, so each step is checked as the caller.


personaId​

personaId: string

Defined in: packages/agentos/src/core/tools/ITool.ts:139

The unique identifier of the active Persona within the GMI that requested the tool execution.


sessionData?​

optional sessionData: Record<string, any>

Defined in: packages/agentos/src/core/tools/ITool.ts:142

Optional. Ephemeral data relevant to the current session, potentially sourced from the GMI's working memory or the orchestrator. This allows tools to access dynamic session state if needed for their operation (e.g., user's current location, temporary files).


signal?​

optional signal: AbortSignal

Defined in: packages/agentos/src/core/tools/ITool.ts:160

The call's stop, when the call carries one (ToolExecutionRequestDetails.signal): its turn's stop on a call a GMI makes; on a step, the one its composed call passes on, or a workflow step's timer joined with the workflow call's own. A tool that runs other tools on the caller's behalf (a composed tool) passes it on, so a step whose call stopped starts nothing: it is refused before its approval is asked, or after the approval when the stop came while it was pending. A tool may end its own work when it aborts; nothing else cuts a call already running.


userContext​

userContext: UserContext

Defined in: packages/agentos/src/core/tools/ITool.ts:140

Contextual information about the end-user associated with the current interaction, which might include user ID, preferences, skill level, etc.