Skip to main content
Glama
UtakataKyosui

PR Review MCP Server

reply_and_resolve

Reply to GitHub pull request review threads and resolve them in one action, streamlining code review feedback management.

Instructions

Reply to a review thread and immediately resolve it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
pull_numberYesPull request number
thread_idYesReview thread ID (from list_review_threads)
bodyYesReply content (Markdown supported)

Implementation Reference

  • The handler function that implements the reply_and_resolve tool: extracts arguments, adds a reply to the thread, resolves the thread, and returns a JSON result.
    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))]
  • Input schema defining parameters for the reply_and_resolve tool: owner, repo, pull_number, thread_id, body.
    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"],
    },
  • Registration of the reply_and_resolve tool in the list_tools function, including name, description, and schema.
    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"],
        },
    ),
  • Dispatch logic in call_tool that routes 'reply_and_resolve' calls to the handler function.
    elif name == "reply_and_resolve":
        return await handle_reply_and_resolve(api, arguments)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/UtakataKyosui/PR-Review-Resolve-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server