Skip to main content
Glama

chroma_create_collection

Create a new Chroma collection with customizable HNSW parameters, embedding functions, and optional metadata to organize and manage AI-generated or user-input data efficiently.

Instructions

Create a new Chroma collection with configurable HNSW parameters.

Args:
    collection_name: Name of the collection to create
    embedding_function_name: Name of the embedding function to use. Options: 'default', 'cohere', 'openai', 'jina', 'voyageai', 'ollama', 'roboflow'
    metadata: Optional metadata dict to add to the collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_nameYes
embedding_function_nameNodefault
metadataNo

Implementation Reference

  • The handler function for 'chroma_create_collection' tool. It creates a new ChromaDB collection with the specified embedding function and metadata using the global Chroma client.
    @mcp.tool()
    async def chroma_create_collection(
        collection_name: str,
        embedding_function_name: str = "default",
        metadata: Dict | None = None,
    ) -> str:
        """Create a new Chroma collection with configurable HNSW parameters.
        
        Args:
            collection_name: Name of the collection to create
            embedding_function_name: Name of the embedding function to use. Options: 'default', 'cohere', 'openai', 'jina', 'voyageai', 'ollama', 'roboflow'
            metadata: Optional metadata dict to add to the collection
        """
        client = get_chroma_client()
        
        embedding_function = mcp_known_embedding_functions[embedding_function_name]
        
        configuration=CreateCollectionConfiguration(
            embedding_function=embedding_function()
        )
        
        try:
            client.create_collection(
                name=collection_name,
                configuration=configuration,
                metadata=metadata
            )
            config_msg = f" with configuration: {configuration}"
            return f"Successfully created collection {collection_name}{config_msg}"
        except Exception as e:
            raise Exception(f"Failed to create collection '{collection_name}': {str(e)}") from e
  • Dictionary of known embedding functions used by the chroma_create_collection handler to select the appropriate embedding function based on the input parameter.
    mcp_known_embedding_functions: Dict[str, EmbeddingFunction] = {
        "default": DefaultEmbeddingFunction,
        "cohere": CohereEmbeddingFunction,
        "openai": OpenAIEmbeddingFunction,
        "jina": JinaEmbeddingFunction,
        "voyageai": VoyageAIEmbeddingFunction,
        "roboflow": RoboflowEmbeddingFunction,
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'configurable HNSW parameters' but doesn't explain what these are, their defaults, or behavioral traits like error handling, permissions needed, or what happens on duplicate collection names. This leaves significant gaps for a mutation tool.

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 appropriately sized and front-loaded with the main purpose, followed by a structured Args section. Each sentence adds value, though the HNSW reference is vague and could be more precise.

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

Completeness3/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 3 parameters with 0% schema coverage, the description is incomplete. It explains parameters well but lacks behavioral context (e.g., mutation effects, error cases) and doesn't address the HNSW configuration mentioned, leaving gaps for a creation tool.

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 adds meaning by explaining each parameter's purpose: collection_name for naming, embedding_function_name with specific options, and metadata as an optional dict. This covers all 3 parameters adequately, though it doesn't detail HNSW parameters mentioned in the opening.

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

Purpose4/5

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

The description clearly states the action ('Create a new Chroma collection') and resource ('Chroma collection'), distinguishing it from siblings like chroma_delete_collection or chroma_modify_collection. However, it doesn't fully specify what 'configurable HNSW parameters' means, which slightly reduces specificity.

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

Usage Guidelines3/5

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

The description implies usage for creating collections, but provides no explicit guidance on when to use this tool versus alternatives like chroma_fork_collection or chroma_modify_collection. It lists embedding function options, which hints at context, but lacks clear when/when-not instructions or prerequisites.

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

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