feat: add include_sha parameter to get_file_contents tool #605
+147
−20
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.
Summary
This PR addresses issue #595 by adding an optional
include_sha
parameter to theget_file_contents
tool, providing a more flexible and performant solution than the previous approach in PR #599.Problem
The
get_file_contents
tool was missing the SHA hash in its response, which is essential for subsequent file update operations usingcreate_or_update_file
. The SHA is required by the GitHub API for any update operation.Solution
Instead of always returning metadata (as in PR #599), this PR adds an
include_sha
boolean parameter that allows users to explicitly choose between:Key Features
Usage Examples
Changes Made
include_sha
boolean parameter to tool schemaTesting
Supersedes
This PR supersedes #599 by providing a more user-friendly and performant solution to the same problem.
Closes #595
Supersedes #599