(ctx context.Context, client *githubv4.Client, args map[string]any)
| 897 | } |
| 898 | |
| 899 | func deleteDiscussionComment(ctx context.Context, client *githubv4.Client, args map[string]any) (*mcp.CallToolResult, any, error) { |
| 900 | commentNodeID, err := requiredCommentNodeID(args) |
| 901 | if err != nil { |
| 902 | return utils.NewToolResultError(err.Error()), nil, nil |
| 903 | } |
| 904 | |
| 905 | input := githubv4.DeleteDiscussionCommentInput{ |
| 906 | ID: githubv4.ID(commentNodeID), |
| 907 | } |
| 908 | |
| 909 | var mutation struct { |
| 910 | DeleteDiscussionComment struct { |
| 911 | Comment struct { |
| 912 | ID githubv4.ID |
| 913 | URL githubv4.String `graphql:"url"` |
| 914 | } |
| 915 | } `graphql:"deleteDiscussionComment(input: $input)"` |
| 916 | } |
| 917 | |
| 918 | if err := client.Mutate(ctx, &mutation, input, nil); err != nil { |
| 919 | return utils.NewToolResultError(err.Error()), nil, nil |
| 920 | } |
| 921 | |
| 922 | comment := mutation.DeleteDiscussionComment.Comment |
| 923 | out, err := json.Marshal(MinimalResponse{ |
| 924 | ID: fmt.Sprintf("%v", comment.ID), |
| 925 | URL: string(comment.URL), |
| 926 | }) |
| 927 | if err != nil { |
| 928 | return nil, nil, fmt.Errorf("failed to marshal comment: %w", err) |
| 929 | } |
| 930 | |
| 931 | return utils.NewToolResultText(string(out)), nil, nil |
| 932 | } |
| 933 | |
| 934 | func markDiscussionCommentAsAnswer(ctx context.Context, client *githubv4.Client, args map[string]any) (*mcp.CallToolResult, any, error) { |
| 935 | commentNodeID, err := requiredCommentNodeID(args) |
no test coverage detected