Skip to content
DocsTry Aspire
DocsTry

FoundryToolResource Methods

ClassMethods1 member
Base class for Foundry tool resources that participate in the Aspire application model.
ToAgentToolAsync(CancellationToken)Section titled ToAgentToolAsync(CancellationToken)abstractTask<ResponseTool>
Converts this tool definition into the SDK Responses.ResponseTool representation.
public abstract class FoundryToolResource
{
public abstract Task<ResponseTool> ToAgentToolAsync(
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
cancellationTokenCancellationTokenoptionalA cancellation token.
Task<ResponseTool>The SDK tool representation.
This method is called at deploy time, after infrastructure provisioning is complete. Tools that depend on provisioned resources (e.g., Azure AI Search connections) can safely resolve their connection identifiers at this point.