Skip to main content
Glama

delete_collection

Permanently removes a collection and all its documents from the MCP Outline Server. Use to delete obsolete or unneeded sections of content, clean up workspace organization, or remove entire project collections. WARNING: Action is irreversible.

Instructions

    Permanently removes a collection and all its documents.
    
    Use this tool when you need to:
    - Remove an entire section of content
    - Delete obsolete project collections
    - Remove collections that are no longer needed
    - Clean up workspace organization
    
    WARNING: This action cannot be undone and will delete all documents 

within the collection.

    Args:
        collection_id: The collection ID to delete
        
    Returns:
        Result message confirming deletion
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYes

Implementation Reference

  • The MCP tool handler implementation for delete_collection, decorated with @mcp.tool() and conditionally defined inside register_tools based on environment variables. Calls get_outline_client() and client.delete_collection().
    @mcp.tool(
        annotations=ToolAnnotations(
            readOnlyHint=False,
            destructiveHint=True,
            idempotentHint=True,
        )
    )
    async def delete_collection(collection_id: str) -> str:
        """
        Permanently removes a collection and all its documents.
    
        Use this tool when you need to:
        - Remove an entire section of content
        - Delete obsolete project collections
        - Remove collections that are no longer needed
        - Clean up workspace organization
    
        WARNING: This action cannot be undone and will delete all
        documents within the collection.
    
        Args:
            collection_id: The collection ID to delete
    
        Returns:
            Result message confirming deletion
        """
        try:
            client = await get_outline_client()
            success = await client.delete_collection(collection_id)
    
            if success:
                return (
                    "Collection and all its documents deleted "
                    "successfully."
                )
            else:
                return "Failed to delete collection."
        except OutlineClientError as e:
            return f"Error deleting collection: {str(e)}"
        except Exception as e:
            return f"Unexpected error: {str(e)}"
  • The OutlineClient helper method that performs the actual API call to delete the collection via POST to collections.delete endpoint.
    async def delete_collection(self, collection_id: str) -> bool:
        """
        Delete a collection and all its documents.
    
        Args:
            collection_id: The ID of the collection to delete
    
        Returns:
            Success status
        """
        response = await self.post("collections.delete", {"id": collection_id})
        return response.get("success", False)
  • Invocation of collection_tools.register_tools(mcp) which contains the conditional registration of the delete_collection tool.
    collection_tools.register_tools(mcp)
  • Top-level registration of all features via register_all(mcp), which chains to documents.register(mcp) and then collection_tools.register_tools(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