fix: get_file_contents use "/" for root#666
Merged
LuluBeatson merged 5 commits intomainfrom Jul 11, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with the get_file_contents function where agents couldn't access the root directory due to unclear parameter documentation. The fix clarifies that root directory access requires using "/" as the path parameter.
- Updated parameter description to explicitly mention root directory handling
- Ensured consistency across code documentation and README
- Fixed agent confusion about empty string vs "/" for root directory access
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/github/repositories.go | Updated path parameter description to clarify root directory usage |
| pkg/github/toolsnaps/get_file_contents.snap | Updated test snapshot to reflect new parameter description |
| README.md | Updated documentation to match the corrected parameter description |
tonytrg
reviewed
Jul 11, 2025
tonytrg
reviewed
Jul 11, 2025
Contributor
Author
|
Thank you @tonytrg. I've decided to go your suggestion of making the path optional with "/" default - I think this most reliable |
nickytonline
pushed a commit
to nickytonline/github-mcp-http
that referenced
this pull request
Oct 4, 2025
* update path description to use "/" for root * update docs and toolsnaps * use mcp.DefaultString, revert description, update unit test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: To get root directory, agent was calling
get_file_contentswith path""which is not allowed for a required param.Fix: Changed
pathto an optional and set a default of"/"(root)Screenshot
Tested with: Sonnet-3.5, Sonnet-4, GPT-o4-mini, GPT-4o
Check the tool is called with path="/"