Skip to content

MCP Error -32603: 422 Invalid request - 'sha' wasn't supplied when updating file #191

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

Open
evanmcgillivray opened this issue Apr 9, 2025 · 0 comments · May be fixed by #320
Open

MCP Error -32603: 422 Invalid request - 'sha' wasn't supplied when updating file #191

evanmcgillivray opened this issue Apr 9, 2025 · 0 comments · May be fixed by #320
Labels
dependencies Pull requests that update a dependency file

Comments

@evanmcgillivray
Copy link

Description

When trying to update a file using the create_or_update_file tool, I'm encountering an error where the SHA parameter isn't being supplied, resulting in a 422 Invalid request from the GitHub API.

Error Message

Failed to call tool create_or_update_file: Error: MCP error -32603: failed to https://api.github.com/repos/evanmcgillivray/Budget/contents/src/components
422 Invalid request. "sha" wasn't supplied. []

Steps to Reproduce

  1. Using the MCP server with an AI assistant
  2. Attempting to update a file in a repository
  3. The MCP server fails to include the required SHA parameter in the request

Expected Behavior

The MCP server should properly include the SHA parameter when updating files, as required by the GitHub API.

Additional Information

  • GitHub requires the SHA parameter when updating a file to ensure you're updating the correct version
  • This appears to be happening specifically when trying to update a file via the create_or_update_file function
@SamMorrowDrums SamMorrowDrums added the dependencies Pull requests that update a dependency file label Apr 15, 2025
@crondinini crondinini linked a pull request Apr 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants