# FoundryToolboxResource.withAISearchTool

- Module: [Aspire.Hosting.Foundry](/reference/api/typescript/aspire.hosting.foundry.md)
- Defined on: [FoundryToolboxResource](/reference/api/typescript/aspire.hosting.foundry/foundrytoolboxresource.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `method`

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;
}
```

## Signature

```typescript
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`

## Defined on

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