MCPcopy Create free account
hub / github.com/alibaba/open-code-review / Execute

Method Execute

internal/tool/code_comment.go:53–67  ·  view source on GitHub ↗
(_ context.Context, args map[string]any)

Source from the content-addressed store, hash-verified

51func (p *CodeCommentProvider) Tool() Tool { return CodeComment }
52
53func (p *CodeCommentProvider) Execute(_ context.Context, args map[string]any) (string, error) {
54 if p.Collector == nil {
55 return "Error: comment collector is not configured", nil
56 }
57
58 comments, errMsg := ParseComments(args)
59 if errMsg != "" {
60 return errMsg, nil
61 }
62
63 for i := range comments {
64 p.Collector.Add(comments[i])
65 }
66 return CommentSucceed, nil
67}
68
69// ParseComments extracts LlmComment entries from tool call arguments without writing
70// to the Collector. Returns parsed comments and an error message (empty on success).

Callers 1

Calls 2

ParseCommentsFunction · 0.85
AddMethod · 0.80

Tested by 1