# FoundryToolboxResource

- Module: [Aspire.Hosting.Foundry](/reference/api/go/aspire.hosting.foundry.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Represents a Microsoft Foundry Toolbox endpoint associated with a Foundry project.

## Remarks

Toolboxes are Foundry data-plane resources with no ARM or Bicep representation. Aspire
reconciles the desired tool definitions after the parent project is provisioned, reuses the
current default version when its configuration matches, and promotes a new immutable version
when the configuration changes.

## Definition

```go
type FoundryToolboxResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`

## Methods

- [AsExisting](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/asexisting.md) -- `method` -- Uses an existing Microsoft Foundry Toolbox during local runs and deployment.
  ```go
  AsExisting() FoundryToolboxResource
  ```
- [PublishAsExisting](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/publishasexisting.md) -- `method` -- Reconciles a Microsoft Foundry Toolbox during local runs and uses an existing Toolbox during deployment.
  ```go
  PublishAsExisting() FoundryToolboxResource
  ```
- [RunAsExisting](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/runasexisting.md) -- `method` -- Uses an existing Microsoft Foundry Toolbox during local runs and reconciles it during deployment.
  ```go
  RunAsExisting() FoundryToolboxResource
  ```
- [WithAISearchTool](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/withaisearchtool.md) -- `method` -- Adds an Azure AI Search tool definition to the Toolbox.
  ```go
  WithAISearchTool(name string, search AzureSearchResource, indexName string, options ...*WithAISearchToolOptions) FoundryToolboxResource
  ```
- [WithDescription](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/withdescription.md) -- `method` -- Sets the description persisted with each Toolbox version.
  ```go
  WithDescription(description string) FoundryToolboxResource
  ```
- [WithMcpTool](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/withmcptool.md) -- `method` -- Adds an MCP tool definition to the Toolbox.
  ```go
  WithMcpTool(name string, endpoint any, options ...*FoundryToolboxMcpToolOptions) FoundryToolboxResource
  ```
- [WithWebSearchTool](/reference/api/go/aspire.hosting.foundry/foundrytoolboxresource/withwebsearchtool.md) -- `method` -- Adds a web search tool definition to the Toolbox.
  ```go
  WithWebSearchTool(options ...*WithWebSearchToolOptions) FoundryToolboxResource
  ```
