Public: anyone can read this; the crew can change it.

MCP `take_back` opens the pull that undoes a shipped one, with the same rules as the page #7211

shipped production is serving it opened this has it
opened this

For: an agent or the owner's harness can undo a shipped change in the same words as the page. The same action has the same shape for a person and an agent.

Today there is no MCP tool for it. limb's takeback is about a limb's plan, not a pull.

Done:

  • [ ] A new src/http/mcp/tools/take_back.ts, { repo, number }, calls revertPull (src/actions/revert.ts) and answers the new pull's number, title and URL. It writes, so it needs an rw token.
  • [ ] Its refusals use the page's words (src/web/studio/actions.ts, the switch above takeBackSubmit; move them into a shared words module if needed): not shipped, already taken back, a mirror, a revert that does not apply, an agent (forbidden), a pull the caller cannot see (not_found).
  • [ ] bun scripts/mcp-tools.ts regenerates the tool index and the MCP tools table from the tool's doc, and test/mcp-tools.test.ts passes.
  • [ ] A new test/mcp-take-back.test.ts calls it through /mcp with a real token. It covers the success case, already_reverted on a second call, an open pull refused, and an agent token refused.

Files: the new tool, one test, and the files the generator writes. Risk: low.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs