Skip to main content
Glama

get_comment

Retrieve specific comment details by ID, including content and metadata, for reference or quoting purposes. Optionally include anchor text from the document the comment refers to.

Instructions

    Retrieves a specific comment by its ID.
    
    Use this tool when you need to:
    - View details of a specific comment
    - Reference or quote a particular comment
    - Check comment content and metadata
    - Find a comment mentioned elsewhere
    
    Args:
        comment_id: The comment ID to retrieve
        include_anchor_text: Whether to include the document text that 
            the comment refers to
        
    Returns:
        Formatted string with the comment content and metadata
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
comment_idYes
include_anchor_textNo

Implementation Reference

  • The core handler implementation for the 'get_comment' MCP tool. It fetches the comment details from the Outline API using comments.info endpoint, extracts metadata like author and date, formats the comment data as JSON, and returns a Markdown-formatted string with optional anchor text.
    @mcp.tool(
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True)
    )
    async def get_comment(
        comment_id: str, include_anchor_text: bool = False
    ) -> str:
        """
        Retrieves a specific comment by its ID.
    
        Use this tool when you need to:
        - View details of a specific comment
        - Reference or quote a particular comment
        - Check comment content and metadata
        - Find a comment mentioned elsewhere
    
        Args:
            comment_id: The comment ID to retrieve
            include_anchor_text: Whether to include the document text that
                the comment refers to
    
        Returns:
            Formatted string with the comment content and metadata
        """
        try:
            client = await get_outline_client()
            response = await client.post(
                "comments.info",
                {"id": comment_id, "includeAnchorText": include_anchor_text},
            )
            comment = response.get("data", {})
    
            if not comment:
                return "Comment not found."
    
            user = comment.get("createdBy", {}).get("name", "Unknown User")
            created_at = comment.get("createdAt", "")
            anchor_text = comment.get("anchorText", "")
    
            # Extract data object containing the comment content
            data = comment.get("data", {})
    
            # Convert data to JSON string for display
            try:
                import json
    
                text = json.dumps(data, indent=2)
            except Exception:
                text = str(data)
    
            output = f"# Comment by {user}\n"
            if created_at:
                output += f"Date: {created_at}\n"
            if anchor_text:
                output += f'\nReferencing text: "{anchor_text}"\n'
            if data:
                output += f"\nComment content:\n```json\n{text}\n```\n"
            else:
                output += "\n(No comment content found)\n"
    
            return output
        except OutlineClientError as e:
            return f"Error getting comment: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • Registration point where the document_collaboration module's register_tools function is called on the MCP server instance, thereby registering the get_comment tool along with other collaboration tools.
    document_collaboration.register_tools(mcp)
  • Higher-level registration call that invokes the documents module registration, which in turn registers the document_collaboration tools including get_comment.
    documents.register(mcp)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool retrieves data (implying read-only) and describes the return format ('Formatted string with comment content and metadata'), which is helpful. However, it lacks details on error handling, permissions, rate limits, or whether the operation is idempotent, leaving some behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with distinct sections (purpose, usage guidelines, args, returns) and uses bullet points for readability. It is appropriately sized, though the usage guidelines section is slightly verbose—every sentence earns its place by providing actionable guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 0% schema coverage, the description does a good job covering purpose, usage, parameters, and return format. It could improve by addressing error cases or permissions, but it provides sufficient context for a read operation with two parameters, making it mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains both parameters: comment_id ('The comment ID to retrieve') and include_anchor_text ('Whether to include the document text that the comment refers to'), adding clear semantic meaning beyond the schema's basic types. This covers all parameters adequately, though not exhaustively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves a specific comment by its ID') and the resource ('comment'), distinguishing it from sibling tools like list_document_comments (which lists multiple comments) or add_comment (which creates rather than retrieves). The verb 'retrieves' is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage scenarios in a bulleted list ('Use this tool when you need to...'), including specific cases like viewing details, referencing, checking content, and finding mentioned comments. This clearly differentiates it from alternatives like list_document_comments for bulk operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/Vortiago/mcp-outline'

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