# FunctionToolResource Constructors

- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Type: [FunctionToolResource](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource.md)
- Kind: `Constructors`
- Members: `1`

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

## FunctionToolResource(string, AzureCognitiveServicesProjectResource, string, BinaryData, string?, bool?)

- Name: `Constructor(string, AzureCognitiveServicesProjectResource, string, BinaryData, string?, bool?)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/ToolResources/FunctionToolResource.cs#L37-L46)

Creates a new instance of the [FunctionToolResource](/reference/api/csharp/aspire.hosting.foundry/functiontoolresource.md) class.

```csharp
public sealed class FunctionToolResource
{
    public FunctionToolResource(
        string name,
        AzureCognitiveServicesProjectResource project,
        string functionName,
        BinaryData parameters,
        string? description = null,
        bool? strictModeEnabled = null)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the tool resource.
- `project` ([AzureCognitiveServicesProjectResource](/reference/api/csharp/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md))
  The parent Foundry project resource.
- `functionName` (`string`)
  The name of the function.
- `parameters` (`BinaryData`)
  The JSON schema defining the function parameters.
- `description` (`string?`) `optional`
  A description of what the function does.
- `strictModeEnabled` (`bool?`) `optional`
  Whether to enable strict mode for parameter validation.
