Skip to content

Overview

contox_get_tree returns the complete brain hierarchy as a nested tree. This provides a bird's-eye view of the project knowledge structure, showing how contexts are organized, their tiers, states, and types.

This is useful for understanding the overall memory organization before performing operations like approve, deprecate, or compact.

Parameters

This tool takes no parameters.

Return value

Returns a nested JSON tree where each node contains:

FieldTypeDescription
schemaKeystringBrain schema key
tiernumberTier level: 1 (always loaded), 2 (on-demand), 3 (archive)
statestringState: draft, approved, or deprecated
contextTypestringType: system, reference, or memory
childrenarrayNested child nodes

Usage examples

Viewing the brain structure

User: Show me the memory structure

Claude calls: contox_get_tree()

Response:
{
  "schemaKey": "root",
  "tier": 1,
  "state": "approved",
  "contextType": "system",
  "children": [
    {
      "schemaKey": "root/architecture",
      "tier": 1,
      "state": "approved",
      "contextType": "memory",
      "children": []
    },
    {
      "schemaKey": "root/conventions",
      "tier": 1,
      "state": "approved",
      "contextType": "memory",
      "children": []
    },
    {
      "schemaKey": "root/scan",
      "tier": 2,
      "state": "approved",
      "contextType": "reference",
      "children": [
        {
          "schemaKey": "root/scan/routes",
          "tier": 2,
          "state": "draft",
          "contextType": "reference",
          "children": []
        }
      ]
    }
  ]
}

Notes

  • The tree reflects the current state of all contexts, including drafts and deprecated items.
  • Only contexts with a schemaKey appear in the tree. Contexts without a schemaKey (legacy V1 contexts) are not included.
  • The tree depth is unlimited — it reflects whatever hierarchy has been created via contox_populate or manual parent/child relationships.