---
title: "functionDescriptor(for:)"
framework: coreai
role: symbol
role_heading: Instance Method
path: "coreai/aimodel/functiondescriptor(for:)"
---

# functionDescriptor(for:)

Returns a descriptor for the specified function.

## Declaration

```swift
func functionDescriptor(for functionName: String) -> InferenceFunctionDescriptor?
```

## Parameters

- `functionName`: The name of the function to describe.

## Return Value

Return Value A descriptor for the function, or nil if the model doesn’t contain a function with the specified name.

## Discussion

Discussion Use the descriptor to inspect the function’s inputs, outputs, and state names before loading it for inference.

## See Also

### Loading inference functions

- [loadFunction(named:)](coreai/aimodel/loadfunction(named:).md)
- [functionNames](coreai/aimodel/functionnames.md)
