capsid_change_repo
Change a repo, on Capsid. Needs the write grant.
What it does
Change a namespace's GitHub repo: write or delete a file (on a branch, as a pull request, or directly where the caller may), or create a branch. Every change goes through guardedWrite and its flags. Needs the write grant; a direct write needs the can_direct_write flag, a workflow file the can_write_workflows flag, and a protected or money path its flag.
What a client is told
The MCP hints it carries, so a client can ask before it acts (src/tool-annotations.ts).
- Writes: some action changes state.
- Can overwrite or remove what exists.
- A repeat can change things again.
- Reaches GitHub, Cloudflare or a live site.
Its 3 actions
Chosen by the action argument.
write_fileWrite a file.Write a file to a namespace's GitHub repo. mode 'pr' (default) commits to a new branch, or to branch if given, and opens a PR; mode 'direct' commits straight to the default branch. Mode 'pr' REFUSES branch set to the default branch, and a branch that already has an open PR unless pr names that PR's number. REFUSES any path under .github/workflows/ unless allow_workflow_write: true is passed. mode 'direct' needs the can_direct_write flag, allow_workflow_write the can_write_workflows flag, a protected path can_touch_protected and a money path money_paths. Needs the write grant.
Takes
namespace,path,content,message,mode,branch,repo,allow_workflow_write,pr.delete_fileDelete a file.Delete a file from a namespace's GitHub repo. mode 'pr' (default) commits the deletion to a new branch, or to branch if given, and opens a PR; mode 'direct' deletes on the default branch. Mode 'pr' REFUSES branch set to the default branch, and a branch that already has an open PR unless pr names that PR's number. The file must exist. REFUSES any path under .github/workflows/ unless allow_workflow_write: true is passed. mode 'direct' needs the can_direct_write flag, allow_workflow_write the can_write_workflows flag, a protected path can_touch_protected and a money path money_paths. Needs the write grant.
Takes
namespace,path,message,mode,branch,repo,allow_workflow_write,pr.
Arguments
| Argument | Type | Needed | What it is |
|---|---|---|---|
action | one of: write_file, delete_file, create_branch | always | write_file | delete_file | create_branch. |
namespace | string | always | |
path | string | no | |
content | string | no | |
message | string | no | |
mode | one of: pr, direct | no | |
branch | string | no | |
repo | string | no | A repo label or mapped "owner/name". Defaults to the primary repo. |
allow_workflow_write | boolean | no | Opt in to writing under .github/workflows/, which is refused without it. Needs the can_write_workflows flag; audit-logged. |
pr | whole number | no | The number of branch's open pull request, required when branch has one; the commit then lands on it. Refused if it is not that branch's open pull request. |
from | string | no |