Skip to content

fix: get_file_contents use "/" for root #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 11, 2025
Merged

fix: get_file_contents use "/" for root #666

merged 5 commits into from
Jul 11, 2025

Conversation

LuluBeatson
Copy link
Contributor

@LuluBeatson LuluBeatson commented Jul 11, 2025

Problem: To get root directory, agent was calling get_file_contents with path "" which is not allowed for a required param.

Fix: Changed path to an optional and set a default of "/" (root)

Screenshot

Tested with: Sonnet-3.5, Sonnet-4, GPT-o4-mini, GPT-4o

get the contents of the github/github-mcp-server repo

Check the tool is called with path="/"

image

@LuluBeatson LuluBeatson marked this pull request as ready for review July 11, 2025 13:41
@Copilot Copilot AI review requested due to automatic review settings July 11, 2025 13:41
@LuluBeatson LuluBeatson requested a review from a team as a code owner July 11, 2025 13:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@LuluBeatson
Copy link
Contributor Author

Thank you @tonytrg. I've decided to go your suggestion of making the path optional with "/" default - I think this most reliable

Copy link
Contributor

@tonytrg tonytrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@LuluBeatson LuluBeatson merged commit d15026b into main Jul 11, 2025
16 checks passed
@LuluBeatson LuluBeatson deleted the lulu/empty-path branch July 11, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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