Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Toolget_file_contents is missing the requiredsha in its response #595

Open
@yonaka15

Description

@yonaka15

Theget_file_contents tool does not return the SHA hash of the file, which is essential for updating files usingcreate_or_update_file.

Description

When calling thegithub.get_file_contents tool, the response object does not include thesha field for the requested file. The official GitHub REST API documentation for theGET /repos/{owner}/{repo}/contents/{path} endpoint confirms that thesha is expected in the response.

This omission prevents the direct use of thegithub.create_or_update_file tool, as it requires the blob's SHA for any update operation.

Expected Behavior

The response fromget_file_contents should include the file's SHA hash, consistent with the GitHub API.

{"type":"file","encoding":"base64","size":5362,"name":"file.txt","path":"path/to/file.txt","content":"...","sha":"b23e37d327d520337de2f7a1a4a4b49435b37699" }

Current Behavior

Thesha field is missing from the tool's response.

Workaround

A functional workaround has been identified:

  1. Delete the target file usinggithub.delete_file (which does not require a SHA).
  2. Recreate the file at the same path usinggithub.create_or_update_file with the updated content. This is treated as a new file creation, thus not requiring a SHA.

While effective, this workaround is suboptimal.

Suspected Cause

The server-side implementation of theget_file_contents tool likely fails to parse or include thesha field from the GitHub API response before sending it to the client agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp