Fetch an image, convert it on the server, commit it to GitHub
github_commit_imageDownload a public image, convert, resize or cover-crop it, generate variants, and commit all outputs to a GitHub branch in one commit; use dryRun to preview dimensions and bytes.
Instructions
Download an image from a public URL, convert it (webp by default), resize or cover-crop it, optionally add variants (e.g. a card thumbnail), and commit every output to a branch in one commit. Runs entirely on the server, nothing on the client machine. Use dryRun to see resulting dimensions and bytes first; then register the file in the site's code with github_commit_files (edits).
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": {
"repo": "<repo>",
"branch": "<branch>",
"message": "<message>",
"sourceUrl": "<sourceUrl>",
"path": "<path>"
},
"name": "github_commit_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Destination path in the repo, e.g. 'public/assets/img/blog/cover.webp'. | |
| repo | Yes | Repository as 'owner/name', e.g. 'octocat/my-site'. | |
| focus | No | Crop anchor: 'attention' keeps the visually busiest region, 'centre' crops symmetrically. | attention |
| width | No | Target width. With height too, the image is cover-cropped to exactly that size; alone, height follows the aspect ratio. Never upscaled. | |
| branch | Yes | Branch to commit to, e.g. 'main'. | |
| dryRun | No | Fetch and convert, report dimensions and bytes, commit nothing. | |
| format | No | webp | |
| height | No | ||
| message | Yes | Commit message in the repository's conventions. | |
| quality | No | ||
| variants | No | Extra outputs from the same source (same format/quality/focus), e.g. a 1000×562 card version. | |
| sourceUrl | Yes | http(s) URL of the source image: an image already on a site, a CDN, a shared Google Drive link (uc?export=download&id=…), etc. | |
| createBranch | No |