AgentTool
Namespace: E2E
public sealed class AgentToolA project tool the agent offers to the model beside its own: upstream’s defineTool. It declares whether it
changes the application and which platforms it is offered on; the agent owns dispatch and accounting. The tool’s
name is its key in Tools.
Inheritance: object
Constructors
Section titled “Constructors”AgentTool(string, JsonObject, bool, Func<JsonObject, AgentToolContext, CancellationToken, Task<string>>, IReadOnlyList<string>?)
Section titled “AgentTool(string, JsonObject, bool, Func<JsonObject, AgentToolContext, CancellationToken, Task<string>>, IReadOnlyList<string>?)”public AgentTool(string description, JsonObject inputSchema, bool mutates, Func<JsonObject, AgentToolContext, CancellationToken, Task<string>> executeAsync, IReadOnlyList<string>? platforms = null)A tool that reaches the harness through AgentToolContext: upstream’s getToolContext. It can look at
the screen (a read-only tool only) and keep what it saw as a screenshot of the step.
Parameters
| Name | Type | Description |
|---|---|---|
description |
string | What the model is told the tool does. |
inputSchema |
JsonObject | The JSON schema of the tool’s input. |
mutates |
bool | Whether running the tool can change the application. A mutating tool takes an action slot and ends replay of the step. |
executeAsync |
Func<JsonObject, AgentToolContext, CancellationToken, Task<string>> | Runs the tool with its input as the model wrote it and the context of the step, and answers what the model reads. |
platforms |
IReadOnlyList<string> | The engine platforms the tool is offered on. Null means every platform. |
AgentTool(string, JsonObject, bool, Func<JsonObject, CancellationToken, Task<string>>, IReadOnlyList<string>?)
Section titled “AgentTool(string, JsonObject, bool, Func<JsonObject, CancellationToken, Task<string>>, IReadOnlyList<string>?)”public AgentTool(string description, JsonObject inputSchema, bool mutates, Func<JsonObject, CancellationToken, Task<string>> executeAsync, IReadOnlyList<string>? platforms = null)Parameters
| Name | Type | Description |
|---|---|---|
description |
string | What the model is told the tool does. |
inputSchema |
JsonObject | The JSON schema of the tool’s input. |
mutates |
bool | Whether running the tool can change the application. A mutating tool takes an action slot and ends replay of the step. |
executeAsync |
Func<JsonObject, CancellationToken, Task<string>> | Runs the tool with its input as the model wrote it, and answers what the model reads. |
platforms |
IReadOnlyList<string> | The engine platforms the tool is offered on. Null means every platform. |
Properties
Section titled “Properties”Description
Section titled “Description”public string Description { get; }Value: string
ExecuteAsync
Section titled “ExecuteAsync”public Func<JsonObject, CancellationToken, Task<string>> ExecuteAsync { get; }Runs the tool with no step around it. A tool that reads its AgentToolContext fails there.
Value: Func<JsonObject, CancellationToken, Task<string>>
InputSchema
Section titled “InputSchema”public JsonObject InputSchema { get; }Value: JsonObject
Mutates
Section titled “Mutates”public bool Mutates { get; }Value: bool
Platforms
Section titled “Platforms”public IReadOnlyList<string>? Platforms { get; }The platforms the tool is offered on. Null means every platform.
Value: IReadOnlyList<string>
Methods
Section titled “Methods”AppliesTo(string)
Section titled “AppliesTo(string)”public bool AppliesTo(string platform)True when the tool is offered on <code class=“paramref”>platform</code>.
Parameters
| Name | Type | Description |
|---|---|---|
platform |
string |
Returns: bool