> For the complete documentation index, see [llms.txt](https://syrows-development.gitbook.io/craftventory/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syrows-development.gitbook.io/craftventory/advanced-concepts/context.md).

# Context

The page describes the context concept implemented in the library.

### What is a context?

In the library, a `Context` is a class that **store values identified by keys** which may differ depending on where the context is created and used. It is used in **value providers** and **placeholders**.

### Common values

By default, several values may be added by the library and present in a context. The `CommonContextKeyEnum` is an enumeration that defines the keys of these common values.&#x20;

These keys are described in the following table:

<table><thead><tr><th width="202">Key</th><th width="179">Type</th><th width="151">Type of context</th><th>Description</th></tr></thead><tbody><tr><td><code>VIEWER</code></td><td><code>Player</code></td><td>Everywhere</td><td>The player who is viewing the inventory</td></tr><tr><td><code>INVENTORY</code></td><td><code>FastInventory</code></td><td>Everywhere</td><td>The inventory viewed</td></tr><tr><td><code>SLOT</code></td><td><code>Integer</code></td><td>Item</td><td>The slot of the item</td></tr><tr><td><code>PAGINATION_ID</code></td><td><code>String</code></td><td>Pagination</td><td>The id of the pagination</td></tr><tr><td><code>PAGINATION_ITEM</code></td><td>Depends on what is paginated</td><td>Pagination item</td><td>The current pagination item</td></tr></tbody></table>

{% hint style="warning" %}
Some keys are not available depending on where the context is declared and used. You must always check that the key is present before retrieving its associated value.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://syrows-development.gitbook.io/craftventory/advanced-concepts/context.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
