# Class LittleGhost::ToolExecution

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/ToolExecution.html

Gives runtime hooks one complete view of a tool call while they prepare or
observe its execution.

## Inheritance

`LittleGhost::ToolExecution < Data`

## Attributes

<a id="attribute-i-context"></a>
### `context` (R)

The cooperative RunContext for this work.

<a id="attribute-i-events"></a>
### `events` (R)

Events collected around the tool execution.

<a id="attribute-i-operation_id"></a>
### `operation_id` (R)

The instrumentation operation identifier for this call.

<a id="attribute-i-parent_operation_id"></a>
### `parent_operation_id` (R)

The parent instrumentation operation identifier, when present.

<a id="attribute-i-parent_trace_context"></a>
### `parent_trace_context` (R)

The trace context inherited from the parent operation, when present.

<a id="attribute-i-tool"></a>
### `tool` (R)

The bound Tool instance selected for the call.

<a id="attribute-i-tool_use"></a>
### `tool_use` (R)

The Content::ToolUse requested by the model.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
new(tool_use:, tool:, context:, events:, operation_id:,
    parent_operation_id:, parent_trace_context:) -> ToolExecution
```

Collects one bound tool call for runtime hooks.
