fix: add null check for tool_graph depends_on field

Signed-off-by: James Loope <cronus@stolenshoe.com>
This commit is contained in:
James Loope
2025-12-31 10:19:44 -08:00
parent a990adf3a2
commit 21e424779b
@@ -22,7 +22,7 @@ import McpAppRenderer from './McpApps/McpAppRenderer';
interface ToolGraphNode {
tool: string;
description: string;
depends_on: number[];
depends_on?: number[];
}
type UiMeta = {
@@ -737,7 +737,7 @@ function ToolGraphView({ toolGraph, code }: ToolGraphViewProps) {
toolGraph.forEach((node, index) => {
const deps =
node.depends_on.length > 0 ? ` (uses ${node.depends_on.map((d) => d + 1).join(', ')})` : '';
node.depends_on && node.depends_on.length > 0 ? ` (uses ${node.depends_on.map((d) => d + 1).join(', ')})` : '';
lines.push(`${index + 1}. ${node.tool}: ${node.description}${deps}`);
});