# FoundryToolboxBuilderExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.6.0-preview.1.26478.8`
- Namespace: `Aspire.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Foundry/Toolbox/FoundryToolboxBuilderExtensions.cs)

Extension methods for adding Microsoft Foundry Toolbox resources and tools.

## Definition

```csharp
namespace Aspire.Hosting;

public static class FoundryToolboxBuilderExtensions
{
    // ...
}
```

## Methods

- [AddToolbox(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, Action<FoundryToolboxResource>)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#addtoolbox-iresourcebuilder-azurecognitiveservicesprojectresource-string-action-foundrytoolboxresource) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats ignored` -- Adds a Microsoft Foundry Toolbox endpoint to a Microsoft Foundry project.
- [AsExisting(IResourceBuilder<FoundryToolboxResource>)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#asexisting-iresourcebuilder-foundrytoolboxresource) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Uses an existing Microsoft Foundry Toolbox during local runs and deployment.
- [PublishAsExisting(IResourceBuilder<FoundryToolboxResource>)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#publishasexisting-iresourcebuilder-foundrytoolboxresource) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Reconciles a Microsoft Foundry Toolbox during local runs and uses an existing Toolbox during deployment.
- [RunAsExisting(IResourceBuilder<FoundryToolboxResource>)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#runasexisting-iresourcebuilder-foundrytoolboxresource) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Uses an existing Microsoft Foundry Toolbox during local runs and reconciles it during deployment.
- [WithAISearchTool(IResourceBuilder<FoundryToolboxResource>, string, IResourceBuilder<AzureSearchResource>, string, string?)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#withaisearchtool-iresourcebuilder-foundrytoolboxresource-string-iresourcebuilder-azuresearchresource-string-string) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Adds an Azure AI Search tool definition to the Toolbox.
- [WithDescription(IResourceBuilder<FoundryToolboxResource>, string)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#withdescription-iresourcebuilder-foundrytoolboxresource-string) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Sets the description persisted with each Toolbox version.
- [WithMcpTool(IResourceBuilder<FoundryToolboxResource>, string, string, FoundryToolboxMcpToolOptions?)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#withmcptool-iresourcebuilder-foundrytoolboxresource-string-string-foundrytoolboxmcptooloptions) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats ignored` -- Adds an MCP tool definition to the Toolbox.
- [WithMcpTool(IResourceBuilder<FoundryToolboxResource>, string, EndpointReference, FoundryToolboxMcpToolOptions?)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#withmcptool-iresourcebuilder-foundrytoolboxresource-string-endpointreference-foundrytoolboxmcptooloptions) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats ignored` -- Adds an MCP tool definition to the Toolbox.
- [WithWebSearchTool(IResourceBuilder<FoundryToolboxResource>, string, string?)](/reference/api/csharp/aspire.hosting.foundry/foundrytoolboxbuilderextensions/methods.md#withwebsearchtool-iresourcebuilder-foundrytoolboxresource-string-string) : `IResourceBuilder<FoundryToolboxResource>` `extension` `ats export` -- Adds a web search tool definition to the Toolbox.
