# Class ToolCallResult<T>

Namespace
  AnthropicClient.Models

Assembly
  AnthropicClient.dll

Represents a tool call result.

    public class ToolCallResult<T>

#### Type Parameters

`T`

Inheritance
  object
  ToolCallResult<T>

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### ToolCallResult(T?, Exception, bool)

Initializes a new instance of the ToolCallResult<T> class.

    protected ToolCallResult(T? value, Exception error, bool isSuccess)

#### Parameters

`value` T

  The value of the tool call result.

`error` Exception

  The error of the tool call result.

`isSuccess` bool

  Indicates whether the tool call was successful.

## Properties

### Error

The error of the tool call result.

    public Exception Error { get; }

#### Property Value

Exception

#### Exceptions

InvalidOperationException

  Thrown when the result is successful.

### IsFailure

Indicates whether the tool call failed.

    public bool IsFailure { get; }

#### Property Value

bool

### IsSuccess

Indicates whether the tool call was successful.

    public bool IsSuccess { get; }

#### Property Value

bool

### Value

The value of the tool call result. Can be null if the call failed, the call was successful but the return type is void or Task, or the call was successful but the return value is null

    public T? Value { get; }

#### Property Value

T

#### Exceptions

InvalidOperationException

  Thrown when the result is not successful.

## Methods

### Failure(Exception)

Creates a failed ool call result.

    public static ToolCallResult<T> Failure(Exception error)

#### Parameters

`error` Exception

  The error of the tool call result.

#### Returns

ToolCallResult<T>

  A new instance of the ToolCallResult<T> class.

### Success(T?)

Creates a successful tool call result.

    public static ToolCallResult<T> Success(T? value)

#### Parameters

`value` T

  The value of the tool call result.

#### Returns

ToolCallResult<T>

  A new instance of the ToolCallResult<T> class.