Neighbors of a node
query_graph_neighborsList the stored relations around one node, one page at a time, when you need the edges themselves (get_node_stats first when the node has many). Input: node_id (required: this room's opaque node id from search, get_node, explore or paths, never an external id) and namespace_id; limit pages. Returns each edge with its relation type, stored direction, weight (the bundle's strength, such as the shared-ayah count on CO_OCCURS) and properties, and the node it reaches; total counts every match. Filter by relation_types, labels of the far node and direction; sort_by weight (the default), degree or id. Pass next_cursor as cursor to page until it is null. Deterministic for one generation, no model call. A node without any edge returns warning ISOLATED_NODE with the reason its record gives (LEMMA_WITHOUT_ROOT), so an empty page is never silent. No answer synthesis. node_id is the node_id of a search or fetch result, or an id from overview, neighbors or paths, never a physical graph key. depth walks 1 or 2 hops. sort_by: weight lists the heaviest first (unweighted last), degree the best-connected far nodes first, id by far node id; ties by edge id, and hop 1 before hop 2; the same request on the same generation returns the same pages. direction is seen from the near node; an undirected edge has no direction and matches OUT and IN. labels are a bundle node's own labels, such as Root, Lemma, Ayah or Surah; relation_types for example CO_OCCURS or OCCURS_IN. Example: {"node_id": "<node_id>", "namespace_id": "obo-go", "limit": 20}. Since contract 4.3.0 curated relations (typed, versioned, evidence-backed edges kept over the imported graph, made with curate_relation) appear among the edges with layer CURATED and their curation: author, version, status and evidence. The contract revision in force is the one every response repeats in _meta.contract_revision and server_info reports; a revision note (Added in, Since) says when a field or a tool appeared, never which revision is current.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"node_id": "<node_id>"
},
"name": "query_graph_neighbors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Hops to walk from the node, 1 or 2. | |
| limit | No | Relations per page. | |
| cursor | No | next_cursor of the previous page of the same request. | |
| labels | No | Only relations whose far node has one of these labels. | |
| node_id | Yes | This room's opaque node id, never an external id. | |
| sort_by | No | weight: heaviest first. degree: best-connected far nodes first. id: by far node id. | weight |
| direction | No | Seen from the near node; an undirected edge matches OUT and IN. | BOTH |
| namespace_id | No | Room name; omitted: the default room. | |
| relation_types | No | Only relations of these types. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | Yes | ||
| nodes | Yes | ||
| total | No | Added in contract revision 3.1.0. Every relation the request matches, over all pages. | |
| sort_by | No | ||
| warnings | No | Added in contract revision 4.1.0. Set when the node has no edge at all (ISOLATED_NODE with the reason its record gives), so an empty answer reflects missing data rather than the request; empty otherwise. | |
| truncated | Yes | ||
| next_cursor | No | Added in contract revision 3.1.0. Set exactly when truncated is true; send it as cursor with the same request for the next page. Pages of one generation never overlap or skip. |