# TOML

Just like JSON, TOML works with field data. The TOML format has an identifier of "toml" (the file extension of a TOML file) and is available by default.

{% tabs %}
{% tab title="test.toml" %}

```toml
message = "hello, world"

[person]
name = "Bob Smith"
age = 42
```

{% endtab %}

{% tab title="test.stof" %}

```rust
import "./test.toml" as self.Toml;
import text "./test.toml" as self.Cmp; // uses "text" format instead of "toml"

#[main]
fn main() {
    assert_eq(self.Toml.message, "hello, world");
    assert_eq(self.Toml.person.name, "Bob Smith");
    assert_eq(self.Toml.person.age, 42);
    
    const toml = stringify("toml", self.Toml); // string export (fields only)
    assert_eq(toml, self.Cmp.text); // from file string import above
}
```

{% endtab %}
{% endtabs %}


---

# 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.stof.dev/formats/toml.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.
