pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/github/github-mcp-server/commit/d15026b0eb2a2e5d3265a2601798ab28017dc719

s://github.githubassets.com/assets/global-d18f184ea1a06a2c.css" /> fix: get_file_contents use "/" for root (#666) · github/github-mcp-server@d15026b · GitHub
Skip to content

Commit d15026b

Browse files
authored
fix: get_file_contents use "/" for root (#666)
* update path description to use "/" for root * update docs and toolsnaps * use mcp.DefaultString, revert description, update unit test
1 parent c23b1f9 commit d15026b

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
899899

900900
- **get_file_contents** - Get file or directory contents
901901
- `owner`: Repository owner (username or organization) (string, required)
902-
- `path`: Path to file/directory (directories must end with a slash '/') (string, required)
902+
- `path`: Path to file/directory (directories must end with a slash '/') (string, optional)
903903
- `ref`: Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head` (string, optional)
904904
- `repo`: Repository name (string, required)
905905
- `sha`: Accepts optional commit SHA. If specified, it will be used instead of ref (string, optional)

pkg/github/__toolsnaps__/get_file_contents.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"type": "string"
1212
},
1313
"path": {
14+
"default": "/",
1415
"description": "Path to file/directory (directories must end with a slash '/')",
1516
"type": "string"
1617
},
@@ -29,8 +30,7 @@
2930
},
3031
"required": [
3132
"owner",
32-
"repo",
33-
"path"
33+
"repo"
3434
],
3535
"type": "object"
3636
},

pkg/github/repositories.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
462462
mcp.Description("Repository name"),
463463
),
464464
mcp.WithString("path",
465-
mcp.Required(),
466465
mcp.Description("Path to file/directory (directories must end with a slash '/')"),
466+
mcp.DefaultString("/"),
467467
),
468468
mcp.WithString("ref",
469469
mcp.Description("Accepts optional git refs such as `refs/tags/{tag}`, `refs/heads/{branch}` or `refs/pull/{pr_number}/head`"),

pkg/github/repositories_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Test_GetFileContents(t *testing.T) {
3333
assert.Contains(t, tool.InputSchema.Properties, "path")
3434
assert.Contains(t, tool.InputSchema.Properties, "ref")
3535
assert.Contains(t, tool.InputSchema.Properties, "sha")
36-
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "repo", "path"})
36+
assert.ElementsMatch(t, tool.InputSchema.Required, []string{"owner", "repo"})
3737

3838
// Mock response for raw content
3939
mockRawContent := []byte("# Test Repository\n\nThis is a test repository.")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy