list_collections
Retrieve and display all workspace collections, including names, IDs, and descriptions. Use this tool to organize knowledge bases, find specific collections, or obtain IDs for further operations in the MCP Outline Server.
Instructions
Retrieves and displays all available collections in the workspace.
Use this tool when you need to:
- See what collections exist in the workspace
- Get collection IDs for other operations
- Explore the organization of the knowledge base
- Find a specific collection by name
Returns:
Formatted string containing collection names, IDs, and descriptions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The MCP tool handler for list_collections. Calls the Outline client to fetch collections and formats the output using _format_collections.@mcp.tool( annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True) ) async def list_collections() -> str: """ Retrieves and displays all available collections in the workspace. Use this tool when you need to: - See what collections exist in the workspace - Get collection IDs for other operations - Explore the organization of the knowledge base - Find a specific collection by name Returns: Formatted string containing collection names, IDs, and descriptions """ try: client = await get_outline_client() collections = await client.list_collections() return _format_collections(collections) except OutlineClientError as e: return f"Error listing collections: {str(e)}" except Exception as e: return f"Unexpected error listing collections: {str(e)}"
- Supporting function that formats the raw collections data into a human-readable markdown list.def _format_collections(collections: List[Dict[str, Any]]) -> str: """Format collections into readable text.""" if not collections: return "No collections found." output = "# Collections\n\n" for i, collection in enumerate(collections, 1): name = collection.get("name", "Untitled Collection") coll_id = collection.get("id", "") description = collection.get("description", "") output += f"## {i}. {name}\n" output += f"ID: {coll_id}\n" if description: output += f"Description: {description}\n" output += "\n" return output
- OutlineClient helper method that makes the API call to list collections from Outline server.async def list_collections(self, limit: int = 20) -> List[Dict[str, Any]]: """ List all available collections. Args: limit: Maximum number of results to return Returns: List of collections """ response = await self.post("collections.list", {"limit": limit}) return response.get("data", [])
- src/mcp_outline/features/documents/__init__.py:30-30 (registration)Registration call within the documents.register() function that includes the document_search.register_tools(mcp), which defines the list_collections tool.document_search.register_tools(mcp)
- src/mcp_outline/features/__init__.py:16-32 (registration)Higher-level registration in features/__init__.py where documents.register(mcp) is called as part of register_all(mcp), propagating to document_search tools.documents.register(mcp) # Register MCP resources resources.register(mcp)