Skip to main content
Glama
chroma-core

Chroma MCP Server

Official
by chroma-core

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose all behavioral traits. It only states the basic operation without explaining error handling (e.g., if collection doesn't exist), read-only nature, or return format. This leaves significant ambiguity.

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 concise with a single line and structured docstring. No redundant information, though it could be more informative without being verbose.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description should explain what data is returned (e.g., metadata fields). It does not. The simple parameter and operation suggest a straightforward tool, but missing return type and error behavior leave gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description's Args section merely repeats the parameter name and a trivial description ('Name of the collection'), adding little beyond the schema's title. For a single parameter, the baseline expectation is higher.

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 and resource ('Get information about a Chroma collection'), which distinguishes it from siblings like chroma_list_collections (list all) and chroma_get_collection_count (count). However, it lacks specifics on what 'information' entails.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, such as chroma_list_collections or chroma_get_collection_count. No prerequisites or typical scenarios are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.