connected_components
Identify disconnected subgraphs in the graph by finding connected components. Returns the number of components and the nodes in each.
Instructions
Find connected components (treating the graph as undirected).
A connected component is a maximal set of nodes such that every pair is reachable from every other by following edges in either direction.
Use this tool when: you want to know how many disconnected subgraphs exist, or which nodes belong to the same component. Do NOT use this for: finding dense sub-communities (use louvain).
Returns: JSON object with {num_components, components} where components maps component_id -> list of node IDs.
Error recovery: If every node is its own component, the graph has no edges.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |