@@ -13,53 +13,53 @@ import (
13
13
"github.com/mark3labs/mcp-go/server"
14
14
)
15
15
16
- //getRepositoryContent defines the resource template and handler forthe Repository Content API .
17
- func getRepositoryContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
16
+ //getRepositoryResourceContent defines the resource template and handler forgetting repository content .
17
+ func getRepositoryResourceContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
18
18
return mcp .NewResourceTemplate (
19
19
"repo://{owner}/{repo}/contents{/path*}" ,// Resource template
20
20
t ("RESOURCE_REPOSITORY_CONTENT_DESCRIPTION" ,"Repository Content" ),
21
21
),
22
- repoContentsResourceHandler (client )
22
+ repositoryResourceContentsHandler (client )
23
23
}
24
24
25
- // getRepositoryContent defines the resource template and handler forthe Repository Content API .
26
- func getRepositoryBranchContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
25
+ // getRepositoryContent defines the resource template and handler forgetting repository content for a branch .
26
+ func getRepositoryResourceBranchContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
27
27
return mcp .NewResourceTemplate (
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
- repoContentsResourceHandler (client )
31
+ repositoryResourceContentsHandler (client )
32
32
}
33
33
34
- //getRepositoryContent defines the resource template and handler forthe Repository Content API .
35
- func getRepositoryCommitContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
34
+ //getRepositoryResourceCommitContent defines the resource template and handler forgetting repository content for a commit .
35
+ func getRepositoryResourceCommitContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
36
36
return mcp .NewResourceTemplate (
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
- repoContentsResourceHandler (client )
40
+ repositoryResourceContentsHandler (client )
41
41
}
42
42
43
- //getRepositoryContent defines the resource template and handler forthe Repository Content API .
44
- func getRepositoryTagContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
43
+ //getRepositoryResourceTagContent defines the resource template and handler forgetting repository content for a tag .
44
+ func getRepositoryResourceTagContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
45
45
return mcp .NewResourceTemplate (
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
- repoContentsResourceHandler (client )
49
+ repositoryResourceContentsHandler (client )
50
50
}
51
51
52
- //getRepositoryContent defines the resource template and handler forthe Repository Content API .
53
- func getRepositoryPrContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
52
+ //getRepositoryResourcePrContent defines the resource template and handler forgetting repository content for a pull request .
53
+ func getRepositoryResourcePrContent (client * github.Client ,t translations.TranslationHelperFunc ) (mcp.ResourceTemplate , server.ResourceTemplateHandlerFunc ) {
54
54
return mcp .NewResourceTemplate (
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
- repoContentsResourceHandler (client )
58
+ repositoryResourceContentsHandler (client )
59
59
}
60
60
61
- func repoContentsResourceHandler (client * github.Client )func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {
62
- return func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {// Extract parameters from request.Params.URI
61
+ func repositoryResourceContentsHandler (client * github.Client )func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {
62
+ return func (ctx context.Context ,request mcp.ReadResourceRequest ) ([]mcp.ResourceContents ,error ) {
63
63
64
64
owner := request .Params .Arguments ["owner" ].([]string )[0 ]
65
65
repo := request .Params .Arguments ["repo" ].([]string )[0 ]