# ComputerToolResource

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Foundry`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/ToolResources/BuiltInToolDefinitions.cs)
- Inherits: [FoundryToolResource](/reference/api/csharp/aspire.hosting.foundry/foundrytoolresource.md)

A Foundry tool resource that enables an agent to interact with a computer desktop by taking screenshots, moving the mouse, clicking, and typing.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public sealed class ComputerToolResource
    : Aspire.Hosting.Foundry.FoundryToolResource
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Foundry/ComputerToolResource`

## Remarks

The computer tool requires specifying the display dimensions and environment.

## Constructors

- [ComputerToolResource(string, AzureCognitiveServicesProjectResource, int, int, string)](/reference/api/csharp/aspire.hosting.foundry/computertoolresource/constructors.md#constructor-string-azurecognitiveservicesprojectresource-int-int-string) -- Creates a new instance of the [ComputerToolResource](/reference/api/csharp/aspire.hosting.foundry/computertoolresource.md) class.

## Properties

- [DisplayHeight](/reference/api/csharp/aspire.hosting.foundry/computertoolresource/properties.md#displayheight) : `int` `get` -- Gets the height of the display in pixels.
- [DisplayWidth](/reference/api/csharp/aspire.hosting.foundry/computertoolresource/properties.md#displaywidth) : `int` `get` -- Gets the width of the display in pixels.
- [Environment](/reference/api/csharp/aspire.hosting.foundry/computertoolresource/properties.md#environment) : `string` `get` -- Gets the environment identifier.

## Methods

- [ToAgentToolAsync(CancellationToken)](/reference/api/csharp/aspire.hosting.foundry/computertoolresource/methods.md#toagenttoolasync-cancellationtoken) : `Task<ResponseTool>` -- Converts this tool definition into the SDK `Responses.ResponseTool` representation.
