Skip to main content
Glama

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
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 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))]
  • 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"], }, ),
  • 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)

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