Skip to content

Interface: ToolExecutionContext

Makaio Framework


Makaio Framework / tools-core / ToolExecutionContext

Defined in: ../../../tools/core/src/types.ts:32

Extended execution context for tools that need session and bus access.

Extends MakaioContext with optional sessionId and bus properties for tools that need to:

  • Correlate operations with a specific session (sessionId)
  • Emit events or make requests during execution (bus)
const result = await tool.execute(input, {
cwd: '/workspace',
env: { NODE_ENV: 'development' },
platform: 'posix',
sessionId: 'session-123',
bus: makaioBus,
});
  • MakaioContext

optional adapterId?: string

Defined in: ../../../tools/core/src/types.ts:49

Adapter identifier for adapter-scoped runtime behavior. Provided when the caller knows the concrete runtime adapter instance.


optional adapterName?: string

Defined in: ../../../tools/core/src/types.ts:55

Adapter name for adapter-scoped runtime behavior. Preferred when the caller wants stable logical adapter identity.


optional agentId?: string

Defined in: ../../../tools/core/src/types.ts:43

Agent identifier for attribution (optional). Provided when tool execution is tied to a specific agent.


optional bus?: BusLike

Defined in: ../../../tools/core/src/types.ts:81

Bus instance for event communication. Tools can use this to emit events (e.g., task.created, task.updated).


optional constraints?: Record<string, unknown>

Defined in: ../../../packages/makaio-core/src/context/index.ts:38

Optional constraints that tools can check for specific behaviors

MakaioContext.constraints


cwd: string

Defined in: ../../../packages/makaio-core/src/context/index.ts:26

Working directory for tool execution

MakaioContext.cwd


env: Readonly<Record<string, string>>

Defined in: ../../../packages/makaio-core/src/context/index.ts:29

Read-only environment variables available to the tool

MakaioContext.env


platform: Platform

Defined in: ../../../packages/makaio-core/src/context/index.ts:32

Platform identifier for cross-platform compatibility

MakaioContext.platform


optional sessionId?: string

Defined in: ../../../tools/core/src/types.ts:37

Session identifier for multi-session task correlation. Tools can use this to associate work with a specific session.

MakaioContext.sessionId


optional signal?: AbortSignal

Defined in: ../../../packages/makaio-core/src/context/index.ts:35

Optional abort signal for cancellation support

MakaioContext.signal


optional subagentDepth?: number

Defined in: ../../../packages/makaio-core/src/context/index.ts:47

Current nesting depth in subagent hierarchy (0 = root)

MakaioContext.subagentDepth


optional subagentId?: string

Defined in: ../../../packages/makaio-core/src/context/index.ts:44

Subagent ID if running as a subagent

MakaioContext.subagentId


optional toolCallId?: string

Defined in: ../../../tools/core/src/types.ts:75

Tool call ID for the current invocation. Provided when the tool is executed as part of a structured tool call (e.g., from an LLM response). Allows tools to correlate their execution with the originating tool call in the adapter.


optional turnContext?: Record<string, unknown>

Defined in: ../../../tools/core/src/types.ts:67

Turn-scoped context contributed by PreUserMessage hooks. Toolsets can use this for session-bound execution metadata.


optional turnId?: string

Defined in: ../../../tools/core/src/types.ts:61

Turn identifier for attribution (optional). Provided when tool execution occurs within a specific turn.