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

Function IssueRead

pkg/github/issues.go:609–713  ·  view source on GitHub ↗

IssueRead creates a tool to get details of a specific issue in a GitHub repository.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

607
608// IssueRead creates a tool to get details of a specific issue in a GitHub repository.
609func IssueRead(t translations.TranslationHelperFunc) inventory.ServerTool {
610 schema := &jsonschema.Schema{
611 Type: "object",
612 Properties: map[string]*jsonschema.Schema{
613 "method": {
614 Type: "string",
615 Description: `The read operation to perform on a single issue.
616Options are:
6171. get - Get details of a specific issue.
6182. get_comments - Get issue comments.
6193. get_sub_issues - Get sub-issues (children) of the issue.
6204. get_parent - Get the parent issue, if this issue is a sub-issue of another.
6215. get_labels - Get labels assigned to the issue.
622`,
623 Enum: []any{"get", "get_comments", "get_sub_issues", "get_parent", "get_labels"},
624 },
625 "owner": {
626 Type: "string",
627 Description: "The owner of the repository",
628 },
629 "repo": {
630 Type: "string",
631 Description: "The name of the repository",
632 },
633 "issue_number": {
634 Type: "number",
635 Description: "The number of the issue",
636 },
637 },
638 Required: []string{"method", "owner", "repo", "issue_number"},
639 }
640 WithPagination(schema)
641
642 return NewTool(
643 ToolsetMetadataIssues,
644 mcp.Tool{
645 Name: "issue_read",
646 Description: t("TOOL_ISSUE_READ_DESCRIPTION", "Get information about a specific issue in a GitHub repository."),
647 Annotations: &mcp.ToolAnnotations{
648 Title: t("TOOL_ISSUE_READ_USER_TITLE", "Get issue details"),
649 ReadOnlyHint: true,
650 },
651 InputSchema: schema,
652 },
653 []scopes.Scope{scopes.Repo},
654 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
655 method, err := RequiredParam[string](args, "method")
656 if err != nil {
657 return utils.NewToolResultError(err.Error()), nil, nil
658 }
659
660 owner, err := RequiredParam[string](args, "owner")
661 if err != nil {
662 return utils.NewToolResultError(err.Error()), nil, nil
663 }
664 repo, err := RequiredParam[string](args, "repo")
665 if err != nil {
666 return utils.NewToolResultError(err.Error()), nil, nil

Callers 9

AllToolsFunction · 0.85
Test_GetIssueFunction · 0.85
Test_GetIssueCommentsFunction · 0.85
Test_GetIssueLabelsFunction · 0.85
Test_GetIssueParentFunction · 0.85
Test_GetSubIssuesFunction · 0.85

Calls 15

NewToolResultErrorFunction · 0.92
WithPaginationFunction · 0.85
NewToolFunction · 0.85
RequiredIntFunction · 0.85
OptionalPaginationParamsFunction · 0.85
GetIssueFunction · 0.85
GetIssueCommentsFunction · 0.85
GetSubIssuesFunction · 0.85
GetIssueParentFunction · 0.85
GetIssueLabelsFunction · 0.85

Tested by 8

Test_GetIssueFunction · 0.68
Test_GetIssueCommentsFunction · 0.68
Test_GetIssueLabelsFunction · 0.68
Test_GetIssueParentFunction · 0.68
Test_GetSubIssuesFunction · 0.68