ocd_get_context_tree
Retrieve a hierarchical context tree (table of contents) for specified root IDs. Supports include/exclude glob patterns and tree-text or JSON output for efficient context navigation.
Instructions
[OCD] コンテキストツリー(目次)を取得
パラメータ
rootIds: Context Root の id 配列(list_context_roots で取得した id をそのまま使用)
patterns (optional): include glob(rootId 相対)。指定時は depth より優先
exclude (optional): exclude glob(rootId 相対)。tree から除外
重要: list_context_roots で返却された id を使用してください。 path フィールド(実際のファイルシステムパス)は使用しないでください。
例:
単一: rootIds: ["tairikut-docs"]
複数: rootIds: ["tairikut-docs", "CORE-docs-for-ai"]
フォーマット
tree-text (default): Token効率の良いテキストツリー形式
json: 従来のJSON配列形式
表示フォーマット (treeTextFormat)
デフォルト: "$path: $title $summary" 使用可能な変数: $path, $title, $summary
cwd: 作業ディレクトリ(設定探索の起点)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | 作業ディレクトリ(設定探索の起点) | |
| depth | No | 深さ制限 (省略時は全階層) | |
| format | No | 出力形式 (default: 'tree-text') | |
| exclude | No | exclude glob patterns (rootId 相対)。指定したパスを結果から除外(glob の ignore に変換) | |
| rootIds | Yes | Context Root の id 配列(list_context_roots で取得した id をそのまま使用) 例: ["tairikut-docs"] または ["tairikut-docs", "CORE-docs-for-ai"] | |
| maxNodes | No | 返却ノード数上限 (default: 1000) | |
| patterns | No | include glob patterns (rootId 相対)。指定時は depth の代わりにこれを使用(空配列は未指定扱い) | |
| treeTextFormat | No | 表示フォーマット (default: "$path: $title $summary"). 変数: $path, $title, $summary |