get_neighbors
Retrieve connected nodes and edges for a given node ID. Explore graph neighborhoods with options for direction, edge type, and limit.
Instructions
Get neighboring nodes connected to a given node.
This is the primary tool for graph traversal. Use it to explore the neighborhood of a known node. Returns connected nodes with the edges that link them.
Use this tool when: you have a node ID and want to see what it connects to. Do NOT use this for: finding nodes by property (use search_nodes_by_label) or running complex multi-hop queries (use execute_gql).
Args: node_id: The ID of the node to get neighbors for. direction: "outgoing" (node-->neighbor), "incoming" (neighbor-->node), or "both" (default). Controls which direction of edges to follow. edge_type: Filter by relationship type (e.g. "KNOWS"). None returns all edge types. limit: Maximum neighbors to return (default 50).
Returns: JSON with the center node, a list of neighbors (with connecting edge info), and counts.
Examples: get_neighbors(0) get_neighbors(42, direction="outgoing") get_neighbors(1, edge_type="KNOWS", limit=10) get_neighbors(5, direction="incoming", edge_type="WORKS_AT")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | ||
| direction | No | both | |
| edge_type | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |