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

Function GranularUpdateIssueState

pkg/github/issues_granular.go:646–678  ·  view source on GitHub ↗

GranularUpdateIssueState creates a tool to update an issue's state.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

644
645// GranularUpdateIssueState creates a tool to update an issue's state.
646func GranularUpdateIssueState(t translations.TranslationHelperFunc) inventory.ServerTool {
647 return issueUpdateTool(t,
648 "update_issue_state",
649 "Update the state of an existing issue (open or closed), with an optional state reason.",
650 "Update Issue State",
651 map[string]*jsonschema.Schema{
652 "state": {
653 Type: "string",
654 Description: "The new state for the issue",
655 Enum: []any{"open", "closed"},
656 },
657 "state_reason": {
658 Type: "string",
659 Description: "The reason for the state change (only for closed state)",
660 Enum: []any{"completed", "not_planned", "duplicate"},
661 },
662 },
663 []string{"state"},
664 func(args map[string]any) (*github.IssueRequest, error) {
665 state, err := RequiredParam[string](args, "state")
666 if err != nil {
667 return nil, err
668 }
669 req := &github.IssueRequest{State: &state}
670
671 stateReason, _ := OptionalParam[string](args, "state_reason")
672 if stateReason != "" {
673 req.StateReason = &stateReason
674 }
675 return req, nil
676 },
677 )
678}
679
680// GranularAddSubIssue creates a tool to add a sub-issue.
681func GranularAddSubIssue(t translations.TranslationHelperFunc) inventory.ServerTool {

Callers 2

AllToolsFunction · 0.85

Calls 1

issueUpdateToolFunction · 0.85

Tested by 1