create_or_update_file
Creates or updates a file in a GitHub repository by committing content to a specified branch, with support for replacing an existing file via its SHA.
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": "create_or_update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | SHA of file being replaced (for updates) | |
| path | Yes | File path | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner | |
| branch | No | Branch name | |
| content | Yes | File content (will be base64 encoded) | |
| message | Yes | Commit message |