# FunctionType

Class in [Yarn](/api/csharp/yarn.md)

Inherits from `System.Object`

## Summary

A type that represents a function.

```csharp
public class FunctionType : IType, IEquatable<IType>
```

## Remarks

Functions have parameters and a return type, and can be called from script. Instances of this type are created when the host application registers new functions (such as through using the [RegisterFunction(string,Delegate)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-7.md) methods or similar.)

## Constructors

| Name                                                                                           | Description                                                                                     |
| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [FunctionType(IType,IType\[\])](/api/csharp/yarn/yarn.functiontype/yarn.functiontype..ctor.md) | Initialises a new instances of the [FunctionType](/api/csharp/yarn/yarn.functiontype.md) class. |

## Methods

| Name                                                                                          | Description                                        |
| --------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Equals(IType)](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.equals.md)               |                                                    |
| [GetParameterAt(int)](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.getparameterat.md) | Gets the type of the parameter at the given index. |
| [ToString()](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.tostring.md)                |                                                    |

## Properties

| Name                                                                                                   | Description                                                                        |
| ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| [Description](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.description.md)                     | Gets a more verbose description of this type.                                      |
| [Name](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.name.md)                                   | Gets the name of this type.                                                        |
| [Parameters](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.parameters.md)                       | Gets the list of the parameter types that this function is called with.            |
| [Parent](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.parent.md)                               | Gets the parent of this type.                                                      |
| [ReturnType](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.returntype.md)                       | Gets the type of value that this function returns.                                 |
| [TypeMembers](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.typemembers.md)                     | Gets the collection of type information for this type's type members.              |
| [VariadicParameterType](/api/csharp/yarn/yarn.functiontype/yarn.functiontype.variadicparametertype.md) | Gets the type of value that this type of function accepts as a variadic parameter. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/api/csharp/yarn/yarn.functiontype.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
