# SDTF Engine

## Instances

The SDTF Engine can be accessed in:

* the `@specifyapp/sdk` package, by using the `specifyClient.getRepositoryTokenTree` method.
* the `@specifyapp/specify-design-token-format` package, by using the exported `createSDTFEngine` function.

## Public API

```
sdtfEngine.[method]
```

### Query methods

The [Query API](/reference/sdtf-engine/query-api.md) provides methods for locally accessing and iterating the token tree.

### Query runner

The [SDTF Query Language](/reference/sdtf-engine/sdtf-query-language.md) is used into the `sdtfEngine.query.run(query: SDTFQuery)`

### Mutation methods

The [Mutation API](/reference/sdtf-engine/mutation-api.md) provides methods for locally mutating the token tree.

### Top level

#### `renderJSONTree`

Get the JSON representation of the token tree.

```typescript
function renderJSONTree(param: {
  renderOptions:
    | {
        resolveAliases: true;
        allowUnresolvable?: AllowUnresolvable;
        targetMode?: TargetMode;
      }
    | { resolveAliases: false };
}): JSON;
```


---

# 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.specifyapp.com/reference/sdtf-engine.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.
