Create or update file
create_or_update_fileCreate or update files in a Forgejo/Gitea repository and commit the change; for updates, provide the current blob SHA.
Instructions
Create a file, or update an existing one (then sha of the current blob is required). Creates a commit.
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>",
"content": "<content>",
"message": "<message>"
},
"name": "create_or_update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Blob SHA of the file being replaced (omit to create) | |
| path | Yes | ||
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or organization) | |
| branch | No | ||
| content | Yes | New file content as text | |
| message | Yes | Commit message | |
| new_branch | No | Create this new branch for the commit |