review

Submit a unified diff for human review with line comments and approve/reject.

When to use

Call review when the agent has a diff or patch it wants the user to look at before applying — a pre-commit review, an agent-generated refactor, or any change where human sign-off matters.

Example user prompts

  • Send me the diff for review before you commit.
  • Ask me to approve the schema change patch.
  • Give me a line-commentable review of the refactor.

MCP tool signature

request_review(
    diff: str,                          # unified diff
    title: str,
    project: str | None = None,
    base_ref: str | None = None,
    head_ref: str | None = None,
    context_md: str | None = None,
    inline_anchors: list[Anchor] | None = None,
    require: Literal['approve', 'comment', 'any'] = 'approve',
    ttl_minutes: int = 1440,
) -> ReviewHandle   # {review_id, web_url, expires_at}

Example call

import subprocess
diff = subprocess.check_output(['git', 'diff', 'HEAD'], text=True)

handle = request_review(
    diff=diff,
    title='Refactor: extract payment module',
    context_md='Extracted 3 functions from billing.py. Tests pass.',
    require='approve',
)
print(f'Review at: {handle["web_url"]}')

Return value

Returns a ReviewHandle with review_id, web_url, and expires_at. The user sees a syntax-highlighted diff with line-comment capability and approve/reject buttons. Resolves like ask — poll or await.

Credit cost

3 actions per create call.

Notes

This is not a GitHub PR replacement. It targets local or agent-generated patches, not open-source collaboration. For GitHub PR reviews, use GitHub's native tooling.

Recipes

See all recipes for copy-paste patterns that use review and other tools together.