github_mcp.write_file
Creates or replaces a planned file in an editable job workspace, requiring the current SHA-256 checksum for existing files and returning path, checksum, and byte count.
Instructions
Create or replace a planned file in an editable job workspace. For existing files, first read_file with the job ID and supply its checksum; for new files use null. Returns path, SHA-256 checksum and byte count. Invalidates preview and checks; does not commit or push.
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": {
"job_id": "<job_id>",
"path": "<path>",
"content": "<content>"
},
"name": "github_mcp.write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Planned repository-relative file path. | |
| job_id | Yes | Existing editable job identifier. | |
| content | Yes | Complete replacement content, UTF-8 text or base64 according to encoding. | |
| encoding | No | utf-8 (default) or base64; binary writes require trusted policy. | utf-8 |
| executable | No | Optional executable-bit setting; null preserves existing behavior. | |
| expected_checksum | No | Current SHA-256 checksum for an existing file; null for a new file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| message | No | ||
| error_code | No |