René's URL Explorer Experiment


Title: feat: add include_sha parameter to get_file_contents tool by yonaka15 · Pull Request #605 · github/github-mcp-server · GitHub

Open Graph Title: feat: add include_sha parameter to get_file_contents tool by yonaka15 · Pull Request #605 · github/github-mcp-server

X Title: feat: add include_sha parameter to get_file_contents tool by yonaka15 · Pull Request #605 · github/github-mcp-server

Description: Summary This PR addresses issue #595 by adding an optional include_sha parameter to the get_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 using create_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: Raw content (default): Fast retrieval via GitHub's Raw API File metadata: Complete file information including SHA, size, type via Contents API Key Features ✅ Backward compatible: Default behavior unchanged ✅ Performance optimized: Raw API used when metadata not needed ✅ Flexible: Works for both files and directories ✅ Comprehensive: Returns complete GitHub API metadata when requested ✅ Well-tested: Full test coverage for all scenarios Usage Examples // Get file content (existing behavior) get_file_contents({ owner: "user", repo: "repo", path: "file.md" }) // Returns: raw file content // Get file metadata including SHA get_file_contents({ owner: "user", repo: "repo", path: "file.md", include_sha: true }) // Returns: { name, path, sha, size, type, content, encoding, ... } Changes Made Added include_sha boolean parameter to tool schema Updated implementation to conditionally use Contents API vs Raw API Enhanced tool description to document new parameter Added comprehensive test coverage for all scenarios Updated tool snapshots to reflect schema changes Testing ✅ All existing tests pass ✅ New test cases cover include_sha functionality ✅ Edge cases and error scenarios tested ✅ Both file and directory metadata retrieval verified Supersedes This PR supersedes #599 by providing a more user-friendly and performant solution to the same problem. Closes #595 Supersedes #599

Open Graph Description: Summary This PR addresses issue #595 by adding an optional include_sha parameter to the get_file_contents tool, providing a more flexible and performant solution than the previous approach in PR #5...

X Description: Summary This PR addresses issue #595 by adding an optional include_sha parameter to the get_file_contents tool, providing a more flexible and performant solution than the previous approach in PR #5...

Opengraph URL: https://github.com/github/github-mcp-server/pull/605

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:623584b1-014b-d7d0-45c6-44353cc00fbe
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA8E4:1D3E0A:12101C0:18E5575:6B06B8EF
html-safe-nonce3cc79cb2108a362bf1e0fc5aaed282ee4120db6dc891f0cf2b039ff417822015
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEU0OjFEM0UwQToxMjEwMUMwOjE4RTU1NzU6NkIwNkI4RUYiLCJ2aXNpdG9yX2lkIjoiMTMzMjQxOTY0NzY1NTU5MDIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc153e0f0b861c0119a7158004632e998571aa36a233c31fc9ab2b3b3cde2e9a5
hovercard-subject-tagpull_request:2626559040
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/github-mcp-server/pull/605/files
twitter:imagehttps://avatars.githubusercontent.com/u/10888995?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10888995?s=400&v=4
og:image:altSummary This PR addresses issue #595 by adding an optional include_sha parameter to the get_file_contents tool, providing a more flexible and performant solution than the previous approach in PR #5...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None32031aaff792fa7ad778f7418e1fbfc0d525a5779804329b769aa75230448a18
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id942771284
octolytics-dimension-repository_nwogithub/github-mcp-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id942771284
octolytics-dimension-repository_network_root_nwogithub/github-mcp-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release37014d914b7d14eede971655595f687a0202af40
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/github-mcp-server/pull/605/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F605%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fpull%2F605%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/pull/605/files
Reloadhttps://github.com/github/github-mcp-server/pull/605/files
Reloadhttps://github.com/github/github-mcp-server/pull/605/files
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues239 (239)https://github.com/github/github-mcp-server/issues
Pull requests228 (228)https://github.com/github/github-mcp-server/pulls
Discussionshttps://github.com/github/github-mcp-server/discussions
Actionshttps://github.com/github/github-mcp-server/actions
Security and quality2 (2)https://github.com/github/github-mcp-server/security
Insightshttps://github.com/github/github-mcp-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fgithub-mcp-server%2Fissues%2Fnew%2Fchoose
yonaka15https://github.com/yonaka15
github:mainhttps://github.com/github/github-mcp-server/tree/main
yonaka15:feature/refine-get-file-contents-v8https://github.com/yonaka15/github-mcp-server/tree/feature/refine-get-file-contents-v8
Conversation 3 https://github.com/github/github-mcp-server/pull/605
Commits 12 https://github.com/github/github-mcp-server/pull/605/commits
Checks 0 https://github.com/github/github-mcp-server/pull/605/checks
Findings https://github.com/github/github-mcp-server/pull/605/findings
Files changed https://github.com/github/github-mcp-server/pull/605/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/605/files
feat: add include_sha parameter to get_file_contents tool https://github.com/github/github-mcp-server/pull/605/files#top
Show all changes 12 commits https://github.com/github/github-mcp-server/pull/605/files
1152eb9 feat: add include_sha parameter to get_file_contents tool yonaka15 Jun 28, 2025 https://github.com/github/github-mcp-server/pull/605/commits/1152eb9c5557f4446a94e530cb12834f9875cfb2
cc5747b feat: add include_sha parameter to get_file_contents tool yonaka15 Jun 28, 2025 https://github.com/github/github-mcp-server/pull/605/commits/cc5747ba78880097aa050f31e7b9e3f68f68f5cc
995e43d chore: add documentation yonaka15 Jun 29, 2025 https://github.com/github/github-mcp-server/pull/605/commits/995e43d39f9c06fed994eeffd0e2aeb235000dd4
23c7ab5 chore: lint yonaka15 Jun 29, 2025 https://github.com/github/github-mcp-server/pull/605/commits/23c7ab5e81b1f7bc94d7316aae7b428e98bbb6cf
f891c92 chore: Reorders the parameters for the tool yonaka15 Jun 29, 2025 https://github.com/github/github-mcp-server/pull/605/commits/f891c92712e0fdb3d2d1ed875a6f7c783cb9cfd2
83866a2 Revert "chore: Reorders the parameters for the tool" yonaka15 Jun 29, 2025 https://github.com/github/github-mcp-server/pull/605/commits/83866a228aa3bd68cbb285b1354fba51c5f68f7b
ffb11ab Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 1, 2025 https://github.com/github/github-mcp-server/pull/605/commits/ffb11ab3e0593b6ff75b0e121b9fb4262c4c9707
95edb3f Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 2, 2025 https://github.com/github/github-mcp-server/pull/605/commits/95edb3fdbbb90ca8a73db3d9c213551e1ae41992
95660a2 Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 3, 2025 https://github.com/github/github-mcp-server/pull/605/commits/95660a286fcc235684cb08585223623d635af37d
67b77e7 Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 4, 2025 https://github.com/github/github-mcp-server/pull/605/commits/67b77e71d300688eac28e3cd47ee5ed4b2b476c6
0b2e7c1 Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 6, 2025 https://github.com/github/github-mcp-server/pull/605/commits/0b2e7c1234c8ff72108044524cbe6262cf4ce07c
58e5bbc Merge branch 'main' into feature/refine-get-file-contents-v8 yonaka15 Jul 8, 2025 https://github.com/github/github-mcp-server/pull/605/commits/58e5bbca520a59b3572e4c07e9737bb39335d5fa
Clear filters https://github.com/github/github-mcp-server/pull/605/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/605/files
Please reload this pagehttps://github.com/github/github-mcp-server/pull/605/files
README.md https://github.com/github/github-mcp-server/pull/605/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
get_file_contents.snap https://github.com/github/github-mcp-server/pull/605/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
repositories.go https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
repositories_test.go https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
README.mdhttps://github.com/github/github-mcp-server/pull/605/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/yonaka15/github-mcp-server/blob/58e5bbca520a59b3572e4c07e9737bb39335d5fa/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/605/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/605/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/github/github-mcp-server/pull/605/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/__toolsnaps__/get_file_contents.snaphttps://github.com/github/github-mcp-server/pull/605/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
View file https://github.com/yonaka15/github-mcp-server/blob/58e5bbca520a59b3572e4c07e9737bb39335d5fa/pkg/github/__toolsnaps__/get_file_contents.snap
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/605/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/605/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
https://github.com/github/github-mcp-server/pull/605/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
https://github.com/github/github-mcp-server/pull/605/files#diff-2d050b2b798718a28d0a0c2ac76cde287bdbfea22cd405025a78b353638c92db
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories.gohttps://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
View file https://github.com/yonaka15/github-mcp-server/blob/58e5bbca520a59b3572e4c07e9737bb39335d5fa/pkg/github/repositories.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/605/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/pull/605/files#diff-396c76ab9d216fd1d9043c561bf2bfe57ade719aa0c0cedb47e85b3277714b92
https://github.com/github/github-mcp-server/blob/main/.github/CODEOWNERS#L1
pkg/github/repositories_test.gohttps://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
View file https://github.com/yonaka15/github-mcp-server/blob/58e5bbca520a59b3572e4c07e9737bb39335d5fa/pkg/github/repositories_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/github-mcp-server/pull/605/{{ revealButtonHref }}
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com/github/github-mcp-server/pull/605/files#diff-1f37596d401182a6443ebc5cf77fd4451cb48bd6f8a3ca31742a7a29feed4279
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.