Skip to main content
Glama

chroma_get_collection_info

Retrieve detailed information about a specific collection within the Chroma MCP Server, enabling users to analyze and manage data more effectively.

Instructions

Get information about a Chroma collection.

Args:
    collection_name: Name of the collection to get info about

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_nameYes

Implementation Reference

  • The main handler function for the 'chroma_get_collection_info' tool. It retrieves the collection using the Chroma client, gets the document count, peeks at sample documents, and returns a dictionary with name, count, and sample documents. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
    async def chroma_get_collection_info(collection_name: str) -> Dict:
        """Get information about a Chroma collection.
        
        Args:
            collection_name: Name of the collection to get info about
        """
        client = get_chroma_client()
        try:
            collection = client.get_collection(collection_name)
            
            # Get collection count
            count = collection.count()
            
            # Peek at a few documents
            peek_results = collection.peek(limit=3)
            
            return {
                "name": collection_name,
                "count": count,
                "sample_documents": peek_results
            }
        except Exception as e:
            raise Exception(f"Failed to get collection info for '{collection_name}': {str(e)}") from e

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/chroma-core/chroma-mcp'

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