update_file
Create or update a file in a GitHub repository; supply the file path, commit message, content, and SHA when replacing an existing file.
Instructions
Create or update a file in a repository
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": "update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Optional SHA of the file being replaced (required for updating existing files) | |
| path | Yes | Path to the file | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner | |
| branch | No | Optional branch name | |
| content | Yes | File content (Base64 encoded for binary files) | |
| message | Yes | Commit message |