Skip to content

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

Description

@evanmcgillivray

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions