MCPcopy
hub / github.com/github/github-mcp-server / RemoveSubIssue

Function RemoveSubIssue

pkg/github/issues.go:1449–1478  ·  view source on GitHub ↗
(ctx context.Context, client *github.Client, owner string, repo string, issueNumber int, subIssueID int)

Source from the content-addressed store, hash-verified

1447}
1448
1449func RemoveSubIssue(ctx context.Context, client *github.Client, owner string, repo string, issueNumber int, subIssueID int) (*mcp.CallToolResult, error) {
1450 subIssueRequest := github.SubIssueRequest{
1451 SubIssueID: int64(subIssueID),
1452 }
1453
1454 subIssue, resp, err := client.SubIssue.Remove(ctx, owner, repo, int64(issueNumber), subIssueRequest)
1455 if err != nil {
1456 return ghErrors.NewGitHubAPIErrorResponse(ctx,
1457 "failed to remove sub-issue",
1458 resp,
1459 err,
1460 ), nil
1461 }
1462 defer func() { _ = resp.Body.Close() }()
1463
1464 if resp.StatusCode != http.StatusOK {
1465 body, err := io.ReadAll(resp.Body)
1466 if err != nil {
1467 return nil, fmt.Errorf("failed to read response body: %w", err)
1468 }
1469 return ghErrors.NewGitHubAPIStatusErrorResponse(ctx, "failed to remove sub-issue", resp, body), nil
1470 }
1471
1472 r, err := json.Marshal(subIssue)
1473 if err != nil {
1474 return nil, fmt.Errorf("failed to marshal response: %w", err)
1475 }
1476
1477 return utils.NewToolResultText(string(r)), nil
1478}
1479
1480func ReprioritizeSubIssue(ctx context.Context, client *github.Client, owner string, repo string, issueNumber int, subIssueID int, afterID int, beforeID int) (*mcp.CallToolResult, error) {
1481 // Validate that either after_id or before_id is specified, but not both

Callers 2

SubIssueWriteFunction · 0.85
GranularRemoveSubIssueFunction · 0.85

Calls 2

NewToolResultTextFunction · 0.92
CloseMethod · 0.80

Tested by

no test coverage detected