Skip to main content
Glama

add_comment

Enables users to add feedback, ask questions, or reply to comments within a document. Supports markdown for formatting and integrates with the MCP Outline Server for streamlined collaboration.

Instructions

    Adds a comment to a document or replies to an existing comment.
    
    Use this tool when you need to:
    - Provide feedback on document content
    - Ask questions about specific information
    - Reply to another user's comment
    - Collaborate with others on document development
    
    Args:
        document_id: The document to comment on
        text: The comment text (supports markdown)
        parent_comment_id: Optional ID of a parent comment (for replies)
        
    Returns:
        Result message with the new comment ID
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes
parent_comment_idNo
textYes

Implementation Reference

  • The core handler function for the 'add_comment' tool. It uses the OutlineClient to POST to 'comments.create' endpoint with documentId, text, and optional parentCommentId. Includes input schema via type hints and docstring description. Registered via @mcp.tool() decorator with specific annotations.
        annotations=ToolAnnotations(
            readOnlyHint=False,
            destructiveHint=False,
            idempotentHint=False,
        )
    )
    async def add_comment(
        document_id: str, text: str, parent_comment_id: Optional[str] = None
    ) -> str:
        """
        Adds a comment to a document or replies to an existing comment.
    
        Use this tool when you need to:
        - Provide feedback on document content
        - Ask questions about specific information
        - Reply to another user's comment
        - Collaborate with others on document development
    
        Args:
            document_id: The document to comment on
            text: The comment text (supports markdown)
            parent_comment_id: Optional ID of a parent comment (for replies)
    
        Returns:
            Result message with the new comment ID
        """
        try:
            client = await get_outline_client()
    
            data = {"documentId": document_id, "text": text}
    
            if parent_comment_id:
                data["parentCommentId"] = parent_comment_id
    
            response = await client.post("comments.create", data)
            comment = response.get("data", {})
    
            if not comment:
                return "Failed to create comment."
    
            comment_id = comment.get("id", "unknown")
    
            if parent_comment_id:
                return f"Reply added successfully (ID: {comment_id})"
            else:
                return f"Comment added successfully (ID: {comment_id})"
        except OutlineClientError as e:
            return f"Error adding comment: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • Conditional registration of write tools including document_content.register_tools(mcp), which defines and registers the add_comment tool.
    if os.getenv("OUTLINE_READ_ONLY", "").lower() not in (
        "true",
        "1",
        "yes",
    ):
        document_content.register_tools(mcp)
        document_lifecycle.register_tools(mcp)
        document_organization.register_tools(mcp)
        batch_operations.register_tools(mcp)
  • High-level registration call to documents.register(mcp) from register_all(mcp), invoked by the main server.
    documents.register(mcp)
    
    # Register MCP resources
    resources.register(mcp)
  • Entry point registration in the main MCP server.py, calling register_all(mcp).
    register_all(mcp)

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