Skip to content

Agent Mesh

fix(mcp): add nil check for tool in listRes.Tools loop

Antonio Ojea7b9c8f2f4822
diff --git a/cmd/sam-node/mcp_handlers.go b/cmd/sam-node/mcp_handlers.go
index fa57b796..c336c5f5 100644
--- a/cmd/sam-node/mcp_handlers.go
+++ b/cmd/sam-node/mcp_handlers.go
@@ -490,6 +490,9 @@ func (n *SamNode) handleDescribeRemoteTool(ctx context.Context, req *mcp.CallToo
}
for _, t := range listRes.Tools {
+ if t == nil {
+ continue
+ }
if t.Name == actualToolName {
payload := remoteToolDescription{
PeerID: pid.String(),