# addAISearchTool

- 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 an Azure AI Search tool to a Microsoft Foundry project, enabling agents to ground their responses using data from an Azure AI Search index.

## Definition

```typescript
interface AzureCognitiveServicesProjectResource {
  // ... omitted for brevity
  addAISearchTool(
    name: string,
    indexName?: string): AzureAISearchToolResource
}
```

## Parameters

- `name` (`string`)
- `indexName` (`string`) `optional`

## Returns

[AzureAISearchToolResource](/reference/api/typescript/aspire.hosting.foundry/azureaisearchtoolresource.md) `builder`

## Applies to

- [AzureCognitiveServicesProjectResource](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md)
