Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithMcpTool

Method
📦 Aspire.Hosting.Foundry v17.0.0-preview.1.26565.2
func (FoundryToolboxResource) WithMcpTool(
name string,
endpoint any,
options ...*FoundryToolboxMcpToolOptions,
) FoundryToolboxResource

Signature

methodWithMcpToolbuilder
Adds an MCP tool definition to the Toolbox.
WithMcpTool(
name string,
endpoint any,
options ...*FoundryToolboxMcpToolOptions,
) FoundryToolboxResource
namestringThe tool name.
endpointanyThe MCP endpoint. A string URI, an EndpointReference pointing at a resource endpoint, or a ReferenceExpression for cases where the endpoint URL needs to be composed (for example, appending the MCP server's mount path or chaining through a public ingress like a dev tunnel).
options...*FoundryToolboxMcpToolOptionsOptional settings, described under Options.

Optional parameters are passed as the existing *FoundryToolboxMcpToolOptions struct.

FoundryToolboxResource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: