> For the complete documentation index, see [llms.txt](https://doc.anytype.io/anytype-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.anytype.io/anytype-docs/creation/blocks/table-of-contents.md).

# Table of Contents

You can open the Table of Contents in the right sidebar for navigation while editing — the panel stays open as you scroll. The panel automatically closes when you navigate to a different Object.

Alternatively, you can add a Table of Contents block (`/toc`) to any Object. It auto-generates from the headings on the page and updates as you add or remove headings.

<div data-with-frame="true"><figure><img src="/files/iyQFrJCTpJCRholKJ7Tk" alt=""><figcaption></figcaption></figure></div>

## How does it work?

The Table of Contents sections are automatically generated based on the headings blocks on the page—Title (H1), Heading (H2), and Subheading (H3). Simply add a heading block to the page and the table of contents will register it.

* [Toggled Headings](/anytype-docs/creation/blocks/toggled-headings.md) are also included in the Table of Contents.
* Clicking on any section will scroll your view to that section of the object.
* The indentations are determined by the hierarchy level of the headings.


---

# 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://doc.anytype.io/anytype-docs/creation/blocks/table-of-contents.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.
