(ctx context.Context, appId string)
| 47 | } |
| 48 | |
| 49 | func (i *imlMcpModule) subscribeServiceIds(ctx context.Context, appId string) ([]string, error) { |
| 50 | subscribes, err := i.subscriberService.SubscriptionsByApplication(ctx, appId) |
| 51 | if err != nil { |
| 52 | return nil, fmt.Errorf("get subscriber error: %w,app id is %s", err, appId) |
| 53 | } |
| 54 | serviceIds := utils.SliceToSlice(subscribes, func(s *subscribe.Subscribe) string { |
| 55 | return s.Service |
| 56 | }, func(s *subscribe.Subscribe) bool { |
| 57 | return s.ApplyStatus == subscribe.ApplyStatusSubscribe |
| 58 | }) |
| 59 | if len(serviceIds) == 0 { |
| 60 | return nil, fmt.Errorf("no subscriber found,app id is %s", appId) |
| 61 | } |
| 62 | return serviceIds, nil |
| 63 | } |
| 64 | |
| 65 | func (i *imlMcpModule) Services(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { |
| 66 |
no test coverage detected