MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / updateMCPServer

Method updateMCPServer

module/publish/iml.go:655–672  ·  view source on GitHub ↗
(ctx context.Context, sid string, name string, version string)

Source from the content-addressed store, hash-verified

653}
654
655func (i *imlPublishModule) updateMCPServer(ctx context.Context, sid string, name string, version string) error {
656 r, err := i.releaseService.GetRunning(ctx, sid)
657 if err != nil {
658 if errors.Is(err, gorm.ErrRecordNotFound) {
659 return nil
660 }
661 return err
662 }
663 _, _, apiDocCommit, _, _, err := i.releaseService.GetReleaseInfos(ctx, r.UUID)
664 if err != nil {
665 return fmt.Errorf("get release info error: %w", err)
666 }
667 commitDoc, err := i.apiDocService.GetDocCommit(ctx, apiDocCommit.Commit)
668 if err != nil {
669 return fmt.Errorf("get api doc commit error: %w", err)
670 }
671 return mcp_server.SetServerByOpenapi(sid, name, version, commitDoc.Data.Content)
672}
673
674func (i *imlPublishModule) Detail(ctx context.Context, serviceId string, id string) (*dto.PublishDetail, error) {
675 _, err := i.serviceService.Check(ctx, serviceId, asServer)

Callers

nothing calls this directly

Calls 3

GetRunningMethod · 0.65
GetReleaseInfosMethod · 0.65
GetDocCommitMethod · 0.65

Tested by

no test coverage detected