DocsCommontoolsToolContext
Package: @hexos/common

Execution context passed to every tool invocation, carrying conversation and agent metadata.

Provides identifiers for the active agent, conversation, and optional user. The frontendContext field carries arbitrary client-side data sent with each request, enabling per-client behavior such as dynamic approval requirements or environment-specific logic.

Related: ToolDefinition receives this during execution, AgentRuntime builds this from RuntimeInput.

interface ToolContext {
    agentId: string;
    conversationId: string;
    userId?: string;
    frontendContext?: Record<string, unknown>;
}

agentId

string

conversationId

string

userId

string

frontendContext

Record