# withTool

- Module: [Aspire.Hosting.Foundry](/reference/api/typescript/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds a tool to a prompt agent.

## Definition

```typescript
interface AzurePromptAgentResource {
  // ... omitted for brevity
  withTool(tool: FoundryToolResource): AzurePromptAgentResource
}
```

## Parameters

- `tool` ([FoundryToolResource](/reference/api/typescript/aspire.hosting.foundry/foundrytoolresource.md))

## Returns

[AzurePromptAgentResource](/reference/api/typescript/aspire.hosting.foundry/azurepromptagentresource.md) `builder`

## Applies to

- [AzurePromptAgentResource](/reference/api/typescript/aspire.hosting.foundry/azurepromptagentresource.md)
