René's URL Explorer Experiment


Title: `create_or_update_file` content description doesn't specify plaintext, leading models to double-encode · Issue #2981 · github/github-mcp-server · GitHub

Open Graph Title: `create_or_update_file` content description doesn't specify plaintext, leading models to double-encode · Issue #2981 · github/github-mcp-server

X Title: `create_or_update_file` content description doesn't specify plaintext, leading models to double-encode · Issue #2981 · github/github-mcp-server

Description: Describe the bug The content parameter of create_or_update_file expects plaintext, but its description does not say so, and the REST endpoint the tool wraps expects base64. Models frequently resolve that ambiguity by base64-encoding the ...

Open Graph Description: Describe the bug The content parameter of create_or_update_file expects plaintext, but its description does not say so, and the REST endpoint the tool wraps expects base64. Models frequently resolv...

X Description: Describe the bug The content parameter of create_or_update_file expects plaintext, but its description does not say so, and the REST endpoint the tool wraps expects base64. Models frequently resolv...

Opengraph URL: https://github.com/github/github-mcp-server/issues/2981

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`create_or_update_file` content description doesn't specify plaintext, leading models to double-encode","articleBody":"### Describe the bug\n\nThe `content` parameter of `create_or_update_file` expects **plaintext**, but its description\ndoes not say so, and the REST endpoint the tool wraps expects **base64**. Models frequently\nresolve that ambiguity by base64-encoding the content themselves, which the server then encodes\nagain. The result is a successful API call that commits base64 text as the file's contents, with\nno error anywhere.\n\nThe schema says only:\n\n```json\n\"content\": { \"description\": \"Content of the file\", \"type\": \"string\" }\n```\n\nThe server treats it as plaintext and encodes exactly once\n([`pkg/github/repositories.go#L484-L485`](https://github.com/github/github-mcp-server/blob/main/pkg/github/repositories.go#L484-L485)):\n\n```go\n// json.Marshal encodes byte arrays with base64, which is required for the API.\ncontentBytes := []byte(content)\n```\n\nThat is correct behavior. The problem is that a model reading the tool description has no way to\nknow it, while it has very likely seen\n[`PUT /repos/{owner}/{repo}/contents/{path}`](https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents),\nwhose `content` field is documented as \"The new file content, using Base64 encoding.\" Given a\nparameter named `content` on a tool named `create_or_update_file`, pre-encoding is a reasonable\ninference.\n\nThe failure is silent in both directions: the tool returns success, and the resulting file looks\nfine to the API. It surfaces only when a human opens the file and finds one long base64 line.\nDecoding it yields exactly the content the model intended to write.\n\n### Affected versions\n\nNot version-specific. The description is byte-identical in `v1.6.0`, `v1.8.0`, and `main`, so\nupgrading does not change it. The remote server runs the same code and is equally affected.\n\n### Steps to reproduce\n\n1. Point an agent at a repository with `create_or_update_file` available.\n2. Ask it to modify an existing text file and commit the result.\n3. Inspect the committed file.\n\nWhether the model pre-encodes is model- and prompt-dependent, so this does not reproduce 100% of\nthe time. That is arguably what makes it worth fixing: it is an intermittent, silent corruption\nthat depends on how a given model resolves an ambiguous parameter description.\n\n### Expected behavior\n\nThe description states the expected encoding, so a model does not have to guess.\n\n### Suggested fix\n\nA description change is probably sufficient:\n\n```json\n\"content\": {\n  \"description\": \"Content of the file as plain text. Do NOT base64-encode it; the server handles encoding.\",\n  \"type\": \"string\"\n}\n```\n\nOptionally, defensively reject input that is unambiguously already-encoded (valid base64 whose\ndecoding yields valid UTF-8 that differs from the input). That has false-positive risk for files\nthat genuinely contain base64, so the description fix is the safer first step.\n\nThe same ambiguity exists on sibling tools and would be worth fixing together:\n\n- `push_files` — `files[].content`, described as `\"file content\"`\n- `create_gist` — `\"Content for simple single-file gist creation\"`\n- `update_gist` — `\"Content for the file\"`\n\n### Possibly related\n\n- #2182 (`create_or_update_file silently truncates large files`) was closed as not reproducible.\n  Pre-encoding would inflate content by roughly 33% and collapse it to a single line, which could\n  present as truncation, so these may share a root cause.\n- #841 reported the mirror-image problem on the read path.\n","author":{"url":"https://github.com/ericsciple","@type":"Person","name":"ericsciple"},"datePublished":"2026-07-30T20:48:05Z","url":"https://github.com/github/github-mcp-server/issues/2981"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5cfa4bff-8e6f-ae08-d249-4d62bdce3cb8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id89F6:1759AA:984CB5:CC39A9:6B063CDC
html-safe-noncee9736fd99d5093051124a5ce51c9ab56a1e1c210f3fc5cbaa793ab76ed54006d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUY2OjE3NTlBQTo5ODRDQjU6Q0MzOUE5OjZCMDYzQ0RDIiwidmlzaXRvcl9pZCI6IjczMjA3NDAxODU1MjI5NzgwMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac67d0fd0a1674562db523d49e7c318a086d89cb47857747da194e7d1023b01ef6
hovercard-subject-tagissue:5023864403
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/2981/issue_layout
twitter:imagehttps://opengraph.githubassets.com/62707e52b3ea019307e41fd1d6376a6247ade99a2e32e778bcbd4b93581e41c7/github/github-mcp-server/issues/2981
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/62707e52b3ea019307e41fd1d6376a6247ade99a2e32e778bcbd4b93581e41c7/github/github-mcp-server/issues/2981
og:image:altDescribe the bug The content parameter of create_or_update_file expects plaintext, but its description does not say so, and the REST endpoint the tool wraps expects base64. Models frequently resolv...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameericsciple
hostnamegithub.com
expected-hostnamegithub.com
Nonedcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0f38f5735226749ec5e08a8649dce4cb2613d9ad
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/github/github-mcp-server/issues/2981#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fissues%2F2981
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%2Fissues%2F2981
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/issues/2981
Reloadhttps://github.com/github/github-mcp-server/issues/2981
Reloadhttps://github.com/github/github-mcp-server/issues/2981
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues238 (238)https://github.com/github/github-mcp-server/issues
Pull requests226 (226)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
https://github.com/github/github-mcp-server
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/2981
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/2981
create_or_update_file content description doesn't specify plaintext, leading models to double-encodehttps://github.com/github/github-mcp-server/issues/2981#top
https://github.com/ericsciple
ericsciplehttps://github.com/ericsciple
on Jul 30, 2026https://github.com/github/github-mcp-server/issues/2981#issue-5023864403
pkg/github/repositories.go#L484-L485https://github.com/github/github-mcp-server/blob/main/pkg/github/repositories.go#L484-L485
PUT /repos/{owner}/{repo}/contents/{path}https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents
create_or_update_file silently truncates large files (~500+ lines) #2182https://github.com/github/github-mcp-server/issues/2182
Source code files corrupted when server/tool attempts to base64 encode my files on read and write #841https://github.com/github/github-mcp-server/issues/841
github-actionshttps://github.com/apps/github-actions
request ai reviewhttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22request%20ai%20review%22
on Jul 30, 2026https://github.com/github/github-mcp-server/issues/2981#event-28744426144
https://github.com/ericsciple
ericsciplehttps://github.com/ericsciple
on Jul 30, 2026https://github.com/github/github-mcp-server/issues/2981#issuecomment-5136550215
SamMorrowDrumshttps://github.com/SamMorrowDrums
completedhttps://github.com/github/github-mcp-server/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 3, 2026https://github.com/github/github-mcp-server/issues/2981#event-28889056608
Sign up for freehttps://github.com/signup?return_to=https://github.com/github/github-mcp-server/issues/2981
Sign in to commenthttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/2981
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.