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

Function IssueDependencyRead

pkg/github/issue_dependencies.go:70–160  ·  view source on GitHub ↗

IssueDependencyRead creates a tool to read an issue's blocked-by and blocking relationships. It is a separate, feature-flagged tool (rather than a method on the default issue_read) so the whole dependency capability can be gated as a unit without enlarging the default issue tool surface.

(t translations.TranslationHelperFunc)

Source from the content-addressed store, hash-verified

68// the default issue_read) so the whole dependency capability can be gated as a
69// unit without enlarging the default issue tool surface.
70func IssueDependencyRead(t translations.TranslationHelperFunc) inventory.ServerTool {
71 schema := &jsonschema.Schema{
72 Type: "object",
73 Properties: map[string]*jsonschema.Schema{
74 "method": {
75 Type: "string",
76 Description: `The read operation to perform on a single issue's dependencies.
77Options are:
781. get_blocked_by - List the issues that block this issue (this issue is blocked by them).
792. get_blocking - List the issues that this issue blocks.
80`,
81 Enum: []any{"get_blocked_by", "get_blocking"},
82 },
83 "owner": {
84 Type: "string",
85 Description: "The owner of the repository",
86 },
87 "repo": {
88 Type: "string",
89 Description: "The name of the repository",
90 },
91 "issue_number": {
92 Type: "number",
93 Description: "The number of the issue",
94 },
95 },
96 Required: []string{"method", "owner", "repo", "issue_number"},
97 }
98 WithCursorPagination(schema)
99
100 st := NewTool(
101 ToolsetMetadataIssues,
102 mcp.Tool{
103 Name: "issue_dependency_read",
104 Description: t("TOOL_ISSUE_DEPENDENCY_READ_DESCRIPTION", "Read an issue's dependency relationships in a GitHub repository: the issues that block it (blocked_by) or the issues it blocks (blocking)."),
105 Annotations: &mcp.ToolAnnotations{
106 Title: t("TOOL_ISSUE_DEPENDENCY_READ_USER_TITLE", "Read issue dependencies"),
107 ReadOnlyHint: true,
108 },
109 InputSchema: schema,
110 },
111 []scopes.Scope{scopes.Repo},
112 func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args map[string]any) (*mcp.CallToolResult, any, error) {
113 method, err := RequiredParam[string](args, "method")
114 if err != nil {
115 return utils.NewToolResultError(err.Error()), nil, nil
116 }
117 owner, err := RequiredParam[string](args, "owner")
118 if err != nil {
119 return utils.NewToolResultError(err.Error()), nil, nil
120 }
121 repo, err := RequiredParam[string](args, "repo")
122 if err != nil {
123 return utils.NewToolResultError(err.Error()), nil, nil
124 }
125 issueNumber, err := RequiredInt(args, "issue_number")
126 if err != nil {
127 return utils.NewToolResultError(err.Error()), nil, nil

Callers 3

AllToolsFunction · 0.85
Test_IssueDependencyReadFunction · 0.85

Calls 11

NewToolResultErrorFunction · 0.92
WithCursorPaginationFunction · 0.85
NewToolFunction · 0.85
RequiredIntFunction · 0.85
GetIssueBlockedByFunction · 0.85
GetIssueBlockingFunction · 0.85
GetGQLClientMethod · 0.65
ErrorMethod · 0.45
ToGraphQLParamsMethod · 0.45

Tested by 2

Test_IssueDependencyReadFunction · 0.68