Get CWE hierarchy
cwe_get_hierarchyNavigate live CWE parents, children, ancestors, or descendants for a weakness, category, or view. Discover IDs with cwe_search_weaknesses or cwe_list_reference topic views. The default view is 1000; set viewId all for every view. primaryOnly applies only to ancestors. Edges point from parent to child and retain view identity; follow nextCursor for more edges. Continuations re-fetch the traversal and reject changed topology. Empty relations are successful; upstream failures remain errors. Node names come from the loaded catalog and may lag live IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | CWE ID such as CWE-79 or 79, for a weakness, category, or view. | |
| limit | No | Maximum page size; capped at 100 and a 24,000-byte response budget with disclosure. | |
| cursor | No | Opaque continuation returned by this tool. | |
| viewId | No | CWE view ID such as CWE-1000 or 1000, or all; discover with cwe_list_reference topic views. Blank means the default. | 1000 |
| direction | Yes | Live hierarchy direction. | |
| primaryOnly | No | Restrict ancestors to primary parents; invalid for other directions when true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Canonical queried root ID. | |
| cap | No | Effective edge page cap. | |
| edges | No | Deterministically ordered edge page. | |
| error | No | Present when the call failed. Absent on success. | |
| found | No | Whether the root exists according to the live hierarchy response. | |
| nodes | No | Endpoint nodes of this page's edges; the first page also lists roots without edges. | |
| shown | No | Returned edge count. | |
| notice | No | Paging cap or source drift notice. | |
| viewId | No | Canonical selected view or all. | |
| guidance | No | Recovery guidance for an unknown root. | |
| direction | No | Applied traversal direction. | |
| truncated | No | Whether additional edges remain. | |
| pagination | No | Local result pagination. | |
| provenance | No | Loaded catalog provenance. | |
| totalCount | No | Full traversal edge count. | |
| primaryOnly | No | Applied primary ancestor restriction. | |
| retrievedAt | No | Live retrieval time in ISO format. | |
| appliedFilters | No | Normalized traversal and paging inputs. | |
| hierarchyFingerprint | No | Full traversal and catalog version fingerprint. |