# withAISearchTool

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

Adds an Azure AI Search tool definition to the Toolbox.

## Definition

```typescript
interface FoundryToolboxResource {
  // ... omitted for brevity
  withAISearchTool(
    name: string,
    search: AzureSearchResource,
    indexName: string,
    description?: string): FoundryToolboxResource
}
```

## Parameters

- `name` (`string`)
- `search` (`AzureSearchResource`)
- `indexName` (`string`)
- `description` (`string`) `optional`

## Returns

[FoundryToolboxResource](/reference/api/typescript/aspire.hosting.foundry/foundrytoolboxresource.md) `builder`

## Applies to

- [FoundryToolboxResource](/reference/api/typescript/aspire.hosting.foundry/foundrytoolboxresource.md)
