# ToolContext

class ToolContext(val invocationContext: InvocationContext, val actions: EventActions = EventActions(), val functionCallId: String? = null, val toolConfirmation: ToolConfirmation? = null, val eventId: String? = null) : ReadonlyToolContext

ToolContext provides a structured context for executing tools or functions.

## Constructors

ToolContext
Link copied to clipboard
constructor(invocationContext: InvocationContext, actions: EventActions = EventActions(), functionCallId: String? = null, toolConfirmation: ToolConfirmation? = null, eventId: String? = null)

## Properties

actions
Link copied to clipboard
val actions: EventActions
context
Link copied to clipboard
open override val context: ReadonlyContext

The readonly invocation context.

eventId
Link copied to clipboard
open override val eventId: String? = null

The unique ID of the event that triggered this tool call.

functionCallId
Link copied to clipboard
open override val functionCallId: String? = null

The unique ID of the function call.

invocationContext
Link copied to clipboard
val invocationContext: InvocationContext
toolConfirmation
Link copied to clipboard
val toolConfirmation: ToolConfirmation? = null

## Functions

listArtifacts
Link copied to clipboard
open suspend override fun listArtifacts(): List<String>

Lists the artifacts available in the current session.

loadArtifact
Link copied to clipboard
open suspend override fun loadArtifact(name: String, version: Int?): Part?

Loads a specific artifact from the current session.

requestConfirmation
Link copied to clipboard
fun requestConfirmation(hint: String? = null, payload: Any? = null)