Skip to content

Commit 07f9439

Browse files
committed
add lag info to describe
1 parent 13ae696 commit 07f9439

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/mcp/kafka_admin_groups_tools.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,17 @@ func handleKafkaGroupDescribe(ctx context.Context, admin *kadm.Client, request m
191191
return mcp.NewToolResultError(fmt.Sprintf("Failed to describe group: %v", err)), nil
192192
}
193193

194-
jsonBytes, err := json.Marshal(response)
194+
lags, err := admin.Lag(ctx, groupName)
195+
if err != nil {
196+
return mcp.NewToolResultError(fmt.Sprintf("Failed to get lag: %v", err)), nil
197+
}
198+
199+
result := map[string]interface{}{
200+
"group": response,
201+
"lag": lags,
202+
}
203+
204+
jsonBytes, err := json.Marshal(result)
195205
if err != nil {
196206
return mcp.NewToolResultError(fmt.Sprintf("Failed to marshal response: %v", err)), nil
197207
}

0 commit comments

Comments
 (0)