reply_and_resolve
Respond to GitHub pull request review comments and close the discussion thread in one action to maintain clean code review workflows.
Instructions
Reply to a review thread and immediately resolve it
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name | |
| pull_number | Yes | Pull request number | |
| thread_id | Yes | Review thread ID (from list_review_threads) | |
| body | Yes | Reply content (Markdown supported) |
Implementation Reference
- src/pr_review_mcp/tools.py:218-247 (handler)The main handler function for the reply_and_resolve tool. It extracts arguments, gets the PR ID, adds a reply to the review thread, resolves the thread, and returns a JSON-formatted success response with details.async def handle_reply_and_resolve(api: GitHubAPI, arguments: dict[str, Any]) -> list[TextContent]: """Handle reply_and_resolve tool call.""" owner = arguments["owner"] repo = arguments["repo"] pull_number = arguments["pull_number"] thread_id = arguments["thread_id"] body = arguments["body"] # Get PR ID pr_id = api.get_pr_id(owner, repo, pull_number) # Add reply comment = api.add_thread_reply(pr_id, thread_id, body) # Resolve thread thread = api.resolve_thread(thread_id) result = { "success": True, "comment": { "id": comment.get("id"), "author": comment.get("author", {}).get("login"), "body": comment.get("body"), "created_at": comment.get("createdAt"), }, "thread": {"id": thread.get("id"), "is_resolved": thread.get("isResolved", False)}, } return [TextContent(type="text", text=json.dumps(result, indent=2))]
- src/pr_review_mcp/tools.py:80-103 (schema)The input schema definition for the reply_and_resolve tool, specifying required parameters: owner, repo, pull_number, thread_id, body.Tool( name="reply_and_resolve", description="Reply to a review thread and immediately resolve it", inputSchema={ "type": "object", "properties": { "owner": { "type": "string", "description": "Repository owner (username or organization)", }, "repo": {"type": "string", "description": "Repository name"}, "pull_number": {"type": "integer", "description": "Pull request number"}, "thread_id": { "type": "string", "description": "Review thread ID (from list_review_threads)", }, "body": { "type": "string", "description": "Reply content (Markdown supported)", }, }, "required": ["owner", "repo", "pull_number", "thread_id", "body"], }, ),
- src/pr_review_mcp/tools.py:117-118 (registration)Dispatch logic in the call_tool handler that checks the tool name and calls the specific reply_and_resolve handler.elif name == "reply_and_resolve": return await handle_reply_and_resolve(api, arguments)