forked from gitea/gitea-mcp
fix: rename commentIndex variable to commentID for clarity
This commit is contained in:
@@ -363,13 +363,13 @@ func GetSingleIssueCommentByIndexFn(ctx context.Context, req mcp.CallToolRequest | ||||
if !ok { | ||||
return to.ErrorResult(fmt.Errorf("repo is required")) | ||||
} | ||||
commentIndex, ok := req.GetArguments()["commentIndex"].(float64) | ||||
commentID, ok := req.GetArguments()["commentIndex"].(float64) | ||||
if !ok { | ||||
return to.ErrorResult(fmt.Errorf("commentIndex is required")) | ||||
} | ||||
comment, _, err := gitea.Client().GetIssueComment(owner, repo, int64(commentIndex)) | ||||
comment, _, err := gitea.Client().GetIssueComment(owner, repo, int64(commentID)) | ||||
if err != nil { | ||||
return to.ErrorResult(fmt.Errorf("get %v/%v/issues/comments/%v err: %v", owner, repo, int64(commentIndex), err)) | ||||
return to.ErrorResult(fmt.Errorf("get %v/%v/issues/comments/%v err: %v", owner, repo, int64(commentID), err)) | ||||
} | ||||
| ||||
return to.TextResult(comment) | ||||
|
Reference in New Issue
Block a user