File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ type serializedCheckResultsByLevel struct {
8888type serializedCheckResults struct {
8989 ByLevel []serializedCheckResultsByLevel
9090 CurrentLevel serializedLevel
91- NextLevel serializedLevel
91+ NextLevel * serializedLevel
9292}
9393
9494// newToolResult creates a CallToolResult for the passed object handling any json marshaling errors
@@ -455,6 +455,9 @@ var rootCmd = &cobra.Command{
455455 if err != nil {
456456 return nil , err
457457 }
458+ if service .Id == "" {
459+ return nil , fmt .Errorf ("service with id %s not found" , req .Params .Arguments ["serviceId" ].(string ))
460+ }
458461
459462 stats , err := service .GetServiceStats (client )
460463 if err != nil {
@@ -466,10 +469,12 @@ var rootCmd = &cobra.Command{
466469 Alias : stats .Rubric .Level .Alias ,
467470 Index : stats .Rubric .Level .Index ,
468471 },
469- NextLevel : serializedLevel {
472+ }
473+ if stats .Rubric .CheckResults .NextLevel .Level .Alias != "" {
474+ result .NextLevel = & serializedLevel {
470475 Alias : stats .Rubric .CheckResults .NextLevel .Level .Alias ,
471476 Index : stats .Rubric .CheckResults .NextLevel .Level .Index ,
472- },
477+ }
473478 }
474479
475480 for _ , checkResultsByLevel := range stats .Rubric .CheckResults .ByLevel .Nodes {
You can’t perform that action at this time.
0 commit comments