create_or_update_file
Create or update a file in a GitHub repository by specifying owner, repo, path, Base64 content, and commit message; include the blob SHA to overwrite an existing file.
Instructions
Create a new file or update an existing file in a GitHub repository. Docs: https://docs.github.com/en/rest/repos/contents#create-or-update-file-contents
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"owner": "<owner>",
"repo": "<repo>",
"path": "<path>",
"message": "<message>",
"content": "<content>"
},
"name": "create_or_update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Blob SHA of the file being replaced, required when updating an existing file | |
| path | Yes | Path to the file | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or organization login) | |
| branch | No | Branch to commit to (defaults to the default branch) | |
| content | Yes | New file content, Base64-encoded | |
| message | Yes | Commit message |