Skip to content

AgentToolContext

Namespace: E2E

public sealed class AgentToolContext

What a project tool reaches of the step it runs in (upstream’s ToolContext): a look at the screen, and a screenshot kept as evidence of the step. A tool that changes the app may not look: it observes in a separate call.

Inheritance: object

View source

AgentToolContext(StepExecutorContext, bool)

Section titled “AgentToolContext(StepExecutorContext, bool)”
public AgentToolContext(StepExecutorContext context, bool mutates)

Parameters

Name Type Description
context StepExecutorContext The context of the step the tool runs in.
mutates bool Whether the tool changes the app. Such a tool cannot look at the screen.

View source

AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)

Section titled “AttachScreenshotAsync(ExecutorPixels, string, CancellationToken)”
public Task<string> AttachScreenshotAsync(ExecutorPixels pixels, string label, CancellationToken cancellationToken = default)

Upstream’s attachScreenshot: keeps pixels the tool saw as a screenshot of the step, and returns where it landed.

Parameters

Name Type Description
pixels ExecutorPixels
label string
cancellationToken CancellationToken

Returns: Task<string>

View source

ObserveAsync(ExecutorObserveOptions?, CancellationToken)

Section titled “ObserveAsync(ExecutorObserveOptions?, CancellationToken)”
public Task<ExecutorObservation> ObserveAsync(ExecutorObserveOptions? options = null, CancellationToken cancellationToken = default)

Upstream’s observe. A mutating tool is refused with POLICY_DENIED.

Parameters

Name Type Description
options ExecutorObserveOptions
cancellationToken CancellationToken

Returns: Task<ExecutorObservation>

View source