Skip to content

get_inventory

View a tree’s inventory. Every type, tag, and frontmatter key a tree uses, with counts, status and trust-tier totals, and likely near-duplicates (e.g. Policy and Policies). Read-only.

Parameter Type Required Description
tree string No The tree’s slug, as list_trees gives it (not its name). Required unless the Forest has one tree.

One JSON object (see All tools):

Field Type Always Description
tree Tree reference Yes The tree, and the commit it was read at.
inventory object Yes The tree’s metadata.
inventory.concepts number Yes How many concepts the tree has.
inventory.untyped number Yes How many have no usable type.
inventory.types list of Count Yes Each type in use.
inventory.tags list of Count Yes Each tag in use.
inventory.keys list of Count Yes Each top-level frontmatter key in use.
inventory.statuses object: draft | stable | deprecated → number Yes How many concepts have each status.
inventory.trustTiers object: unverified | machine-confirmed | human-reviewed → number Yes How many concepts are at each trust tier.
inventory.stale number Yes How many are past their stale_after date.
inventory.nearDuplicates list of objects Yes Groups of values that are probably meant to be the same.
inventory.nearDuplicates[].field type | tag | key Yes Which kind of value: a type, a tag, or a frontmatter key.
inventory.nearDuplicates[].values list of Count Yes The variants, most used first.
inventory.nearDuplicates[].reasons list of case-or-punctuation | plural | spelling Yes Why they were grouped: they differ only in case or punctuation, as singular and plural, or by a small spelling difference.

Asked “Which types and tags does the company tree use?”, an assistant might call get_inventory with:

Arguments
{
"tree": "company"
}

On OKForest’s test Forest (Acme’s made-up company knowledge), it returns:

Result
{
"tree": {
"slug": "company",
"repo": "acme/acme-okf",
"commit": "abc1234abc1234abc1234abc1234abc1234abc1",
"url": "https://app.okforest.ai/@/3f2b8c1e-9a4d-4c7b-8e2f-6d1a0b5c9e7f/company/"
},
"inventory": {
"concepts": 3,
"untyped": 0,
"types": [
{
"value": "Competitor",
"count": 1
},
{
"value": "Customer",
"count": 1
},
{
"value": "Policy",
"count": 1
}
],
"tags": [
{
"value": "competitor",
"count": 1
},
{
"value": "customer",
"count": 1
},
{
"value": "retail",
"count": 1
}
],
"keys": [
{
"value": "title",
"count": 3
},
{
"value": "type",
"count": 3
},
{
"value": "description",
"count": 2
},
{
"value": "status",
"count": 2
},
{
"value": "tags",
"count": 2
},
{
"value": "verified",
"count": 2
},
{
"value": "generated",
"count": 1
},
{
"value": "stale_after",
"count": 1
}
],
"statuses": {
"draft": 1,
"stable": 1,
"deprecated": 1
},
"trustTiers": {
"unverified": 1,
"machine-confirmed": 1,
"human-reviewed": 1
},
"stale": 1,
"nearDuplicates": []
}
}