Skip to content

ClientToolResult

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

The result of a single client-side tool call, sent back so the run can continue.

public sealed record ClientToolResult : IEquatable<ClientToolResult>

objectClientToolResult

IEquatable<ClientToolResult>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

AgentPrismClientToolExtensions.AddClientTool’s sibling on the run request: the model calls a client-side tool, the server returns the pending call to the caller instead of running it, and the caller sends the outcome back through this contract.

public ClientToolResult()

Identifier of the pending call this result answers. Matches the FunctionCallContent.CallId the run response carried.

public required string CallId { get; init; }

string

A message describing why the client-side call failed, given to the model instead of Result.

public string? ErrorMessage { get; init; }

string?

A client-side tool can fail for reasons the server never sees — the user denied a browser permission, a DOM element was not found. The failure is reported to the model as ordinary tool output, not as an HTTP error: the run continues and the model can recover (retry, explain, ask a follow-up).

The tool’s result, given to the model as plain text. Required unless ErrorMessage is given.

public string? Result { get; init; }

string?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ClientToolResult? other)

other ClientToolResult?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ClientToolResult?, ClientToolResult?)

Section titled “ operator ==(ClientToolResult?, ClientToolResult?)”
public static bool operator ==(ClientToolResult? left, ClientToolResult? right)

left ClientToolResult?

right ClientToolResult?

bool

operator !=(ClientToolResult?, ClientToolResult?)

Section titled “ operator !=(ClientToolResult?, ClientToolResult?)”
public static bool operator !=(ClientToolResult? left, ClientToolResult? right)

left ClientToolResult?

right ClientToolResult?

bool