# FunctionToolResource

- Kind: `class`
- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Foundry`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/ToolResources/FunctionToolResource.cs)
- Inherits: [FoundryToolResource](/reference/api/csharp/aspire.hosting.foundry/foundrytoolresource.md)

A Foundry tool resource that enables an agent to call a user-defined function.

## Definition

```csharp
namespace Aspire.Hosting.Foundry;

public sealed class FunctionToolResource
    : Aspire.Hosting.Foundry.FoundryToolResource
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Foundry/FunctionToolResource`

## Remarks

Function calling tools allow agents to invoke functions defined by the application. The agent decides when to call the function based on the function name, description, and parameter schema, then returns a structured function call request that the application handles.

## Constructors

- [FunctionToolResource(string, AzureCognitiveServicesProjectResource, string, BinaryData, string?, bool?)](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/constructors.md#constructor-string-azurecognitiveservicesprojectresource-string-binarydata-string-bool) -- Creates a new instance of the [FunctionToolResource](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource.md) class.

## Properties

- [Description](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/properties.md#description) : `string?` `get` -- Gets the description of the function.
- [FunctionName](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/properties.md#functionname) : `string` `get` -- Gets the name of the function.
- [Parameters](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/properties.md#parameters) : `BinaryData` `get` -- Gets the JSON schema defining the function parameters.
- [StrictModeEnabled](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/properties.md#strictmodeenabled) : `bool?` `get` -- Gets whether strict mode is enabled for parameter validation.

## Methods

- [ToAgentToolAsync(CancellationToken)](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource/methods.md#toagenttoolasync-cancellationtoken) : `Task<ResponseTool>` -- Converts this tool definition into the SDK `Responses.ResponseTool` representation.
