graph mcp bugfix
This commit is contained in:
parent
3d960bf58e
commit
7892d2885a
|
|
@ -346,15 +346,15 @@ class MCPServer:
|
||||||
|
|
||||||
data = response.data or {}
|
data = response.data or {}
|
||||||
nodes = data.get("nodes", [])
|
nodes = data.get("nodes", [])
|
||||||
links = data.get("links", [])
|
edges = data.get("edges", [])
|
||||||
|
|
||||||
output = [f"Knowledge Graph: {len(nodes)} nodes, {len(links)} connections\n"]
|
output = [f"Knowledge Graph: {len(nodes)} nodes, {len(edges)} connections\n"]
|
||||||
|
|
||||||
# Find most connected notes
|
# Find most connected notes
|
||||||
connection_count: dict[str, int] = {}
|
connection_count: dict[str, int] = {}
|
||||||
for link in links:
|
for edge in edges:
|
||||||
source = link.get("source", "")
|
source = edge.get("source", "")
|
||||||
target = link.get("target", "")
|
target = edge.get("target", "")
|
||||||
connection_count[source] = connection_count.get(source, 0) + 1
|
connection_count[source] = connection_count.get(source, 0) + 1
|
||||||
connection_count[target] = connection_count.get(target, 0) + 1
|
connection_count[target] = connection_count.get(target, 0) + 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue