Skip to main content
Glama

get_discussion

Retrieve all discussion comments for a submission, including rebuttals, reviewer responses, and area chair comments, to facilitate conference review workflows.

Instructions

Get all discussion comments on a submission (rebuttals, reviewer responses, AC comments).

Args: venue_id: The venue identifier. submission_id: The submission's note ID. Provide this OR submission_number. submission_number: The paper number. Provide this OR submission_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
venue_idYes
submission_idNo
submission_numberNo

Implementation Reference

  • Implementation of the get_discussion tool which retrieves and formats discussion comments for a submission.
    async def get_discussion(
        venue_id: str,
        submission_id: str | None = None,
        submission_number: int | None = None,
    ) -> str:
        """Get all discussion comments on a submission (rebuttals, reviewer responses, AC comments).
    
        Args:
            venue_id: The venue identifier.
            submission_id: The submission's note ID. Provide this OR submission_number.
            submission_number: The paper number. Provide this OR submission_id.
        """
        client = get_client()
        note = _resolve_submission(client, venue_id, submission_id, submission_number)
        if not note:
            return "Submission not found."
    
        all_notes = client.get_all_notes(forum=note.id)
        comments = []
        for n in all_notes:
            if n.id == note.id:
                continue
            invitations = n.invitations or []
            is_review = any(
                inv.endswith("Official_Review") or inv.endswith("Meta_Review") or inv.endswith("Decision")
                for inv in invitations
            )
            if not is_review:
                comments.append(n)
    
        if not comments:
            return f"No discussion comments found for Submission #{note.number}."
    
        comments.sort(key=lambda c: c.cdate or 0)
        lines = [f"## Discussion for Submission #{note.number} ({len(comments)} comment(s))\n"]
    
        for comment in comments:
            sig = comment.signatures[0] if comment.signatures else "Unknown"
            author_short = sig.split("/")[-1] if "/" in sig else sig
            text = comment.content.get("comment", {}).get("value", "")
            if not text:
                text = comment.content.get("rebuttal", {}).get("value", "")
            if not text:
                for key, val in comment.content.items():
                    if isinstance(val, dict) and "value" in val and isinstance(val["value"], str):
                        text = val["value"]
                        break
            title = comment.content.get("title", {}).get("value", "")
            date_str = ""
            if comment.cdate:
                dt = datetime.fromtimestamp(comment.cdate / 1000, tz=timezone.utc)
                date_str = f" ({dt.strftime('%Y-%m-%d %H:%M UTC')})"
            readers_str = ", ".join(comment.readers) if comment.readers else "N/A"
            inv_names = [inv.split("/")[-1] for inv in (comment.invitations or [])]
            lines.append(f"### {author_short}{date_str}")
            if title:
                lines.append(f"**{title}**")
            lines.append(f"*Type: {', '.join(inv_names)}* | *Visible to: {readers_str}*")
            lines.append(f"\n{text}\n")
            lines.append("---\n")
        return "\n".join(lines)

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/michaelqshieh/openreview-mcp'

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