@@ -19,7 +19,7 @@ func getRepositoryContent(client *github.Client, t translations.TranslationHelpe
19
19
"repo://{owner}/{repo}/contents{/path*}" ,// Resource template
20
20
t ("RESOURCE_REPOSITORY_CONTENT_DESCRIPTION" ,"Repository Content" ),
21
21
),
22
- handlerFunc (client )
22
+ repoContentsResourceHandler (client )
23
23
}
24
24
25
25
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -28,7 +28,7 @@ func getRepositoryBranchContent(client *github.Client, t translations.Translatio
28
28
"repo://{owner}/{repo}/refs/heads/{branch}/contents{/path*}" ,// Resource template
29
29
t ("RESOURCE_REPOSITORY_CONTENT_BRANCH_DESCRIPTION" ,"Repository Content for specific branch" ),
30
30
),
31
- handlerFunc (client )
31
+ repoContentsResourceHandler (client )
32
32
}
33
33
34
34
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -37,7 +37,7 @@ func getRepositoryCommitContent(client *github.Client, t translations.Translatio
37
37
"repo://{owner}/{repo}/sha/{sha}/contents{/path*}" ,// Resource template
38
38
t ("RESOURCE_REPOSITORY_CONTENT_COMMIT_DESCRIPTION" ,"Repository Content for specific commit" ),
39
39
),
40
- handlerFunc (client )
40
+ repoContentsResourceHandler (client )
41
41
}
42
42
43
43
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -46,7 +46,7 @@ func getRepositoryTagContent(client *github.Client, t translations.TranslationHe
46
46
"repo://{owner}/{repo}/refs/tags/{tag}/contents{/path*}" ,// Resource template
47
47
t ("RESOURCE_REPOSITORY_CONTENT_TAG_DESCRIPTION" ,"Repository Content for specific tag" ),
48
48
),
49
- handlerFunc (client )
49
+ repoContentsResourceHandler (client )
50
50
}
51
51
52
52
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -55,10 +55,10 @@ func getRepositoryPrContent(client *github.Client, t translations.TranslationHel
55
55
"repo://{owner}/{repo}/refs/pull/{pr_number}/head/contents{/path*}" ,// Resource template
56
56
t ("RESOURCE_REPOSITORY_CONTENT_PR_DESCRIPTION" ,"Repository Content for specific pull request" ),
57
57
),
58
- handlerFunc (client )
58
+ repoContentsResourceHandler (client )
59
59
}
60
60
61
- func handlerFunc (client * github.Client )func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {
61
+ func repoContentsResourceHandler (client * github.Client )func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {
62
62
return func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {// Extract parameters from request.Params.URI
63
63
64
64
owner := request .Params .Arguments ["owner" ].([]string )[0 ]
@@ -110,7 +110,8 @@ func handlerFunc(client *github.Client) func(ctx context.Context, request mcp.Re
110
110
}
111
111
return resources ,nil
112
112
113
- }else if fileContent != nil {
113
+ }
114
+ if fileContent != nil {
114
115
// Process the file content and return it as a binary resource
115
116
116
117
if fileContent .Content != nil {