# IVariableAccess

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

## Summary

Provides a mechanism for retrieving values.

```csharp
public interface IVariableAccess
```

## Methods

| Name                                                                                                     | Description                                                                                                                                                                                                                                                                                                                      |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [GetVariableKind(string)](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.getvariablekind.md) | Gets the kind of variable named `name` .                                                                                                                                                                                                                                                                                         |
| [TryGetValue(string,T?)](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.trygetvalue.md)      | Given a variable name, attempts to fetch a value for the variable, either from storage, initial values found in [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) , or by evaluating a smart variable found in [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) . |

## Properties

| Name                                                                                                           | Description                                                                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md)                               | Gets or sets the Yarn [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) that stores information about the initial values of variables, and is able to produce values for smart variables. |
| [SmartVariableEvaluator](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.smartvariableevaluator.md) | Gets or sets the object to use when evaluating smart variables.                                                                                                                                                          |


---

# 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.ivariableaccess.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.
