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

Method Execute

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

Source from the content-addressed store, hash-verified

54func (p *CodeCommentProvider) Tool() Tool { return CodeComment }
55
56func (p *CodeCommentProvider) Execute(_ context.Context, args map[string]any) (string, error) {
57 if p.Collector == nil {
58 return "Error: comment collector is not configured", nil
59 }
60
61 comments, errMsg := ParseComments(args)
62 if errMsg != "" {
63 return errMsg, nil
64 }
65
66 for i := range comments {
67 p.Collector.Add(comments[i])
68 }
69 return CommentSucceed, nil
70}
71
72// ParseComments extracts LlmComment entries from tool call arguments without writing
73// 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