# IFoundryTool

- Kind: `interface`
- 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/IFoundryTool.cs)

Represents a Foundry tool that can be attached to a prompt agent.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public interface IFoundryTool
{
    // ...
}
```

## Remarks

This interface provides an extensibility point for custom tool implementations that don't fit the standard [FoundryToolResource](/reference/api/csharp/aspire.hosting.foundry/foundrytoolresource.md) model. For most scenarios, use the project-level `Add*Tool` methods which return [FoundryToolResource](/reference/api/csharp/aspire.hosting.foundry/foundrytoolresource.md) subclasses.

## Methods

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