Skip to main content
Glama

chroma_list_collections

Retrieve paginated collection names from the Chroma database. Specify limit and offset to manage large datasets. Returns list of names or indicates if no collections exist.

Instructions

List all collection names in the Chroma database with pagination support.

Args:
    limit: Optional maximum number of collections to return
    offset: Optional number of collections to skip before returning results

Returns:
    List of collection names or ["__NO_COLLECTIONS_FOUND__"] if database is empty

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The core handler function for the 'chroma_list_collections' tool. It uses the @mcp.tool() decorator for registration and FastMCP handles schema from type hints and docstring. Retrieves paginated list of Chroma collection names.
    @mcp.tool()
    async def chroma_list_collections(
        limit: int | None = None,
        offset: int | None = None
    ) -> List[str]:
        """List all collection names in the Chroma database with pagination support.
        
        Args:
            limit: Optional maximum number of collections to return
            offset: Optional number of collections to skip before returning results
        
        Returns:
            List of collection names or ["__NO_COLLECTIONS_FOUND__"] if database is empty
        """
        client = get_chroma_client()
        try:
            colls = client.list_collections(limit=limit, offset=offset)
            # Safe handling: If colls is None or empty, return a special marker
            if not colls:
                return ["__NO_COLLECTIONS_FOUND__"]
            # Otherwise iterate to get collection names
            return [coll.name for coll in colls]
    
        except Exception as e:
            raise Exception(f"Failed to list collections: {str(e)}") from e
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: pagination support, handling of empty databases (returns ['__NO_COLLECTIONS_FOUND__']), and that it lists names only. However, it does not mention rate limits, authentication needs, or error conditions, leaving some gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by structured sections for Args and Returns. Every sentence earns its place by providing essential information without redundancy.

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

Completeness4/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 2 parameters with 0% schema coverage, the description is largely complete: it explains purpose, parameters, and return behavior. However, it lacks details on error handling or performance characteristics, which could be relevant for a database tool.

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

Parameters5/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 fully explains both parameters (limit and offset) with clear semantics beyond the schema, including their optional nature and purpose (maximum number to return, number to skip). This adds significant value over the bare schema.

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

Purpose5/5

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

The description clearly states the specific action ('List all collection names') and resource ('in the Chroma database'), distinguishing it from siblings like chroma_get_collection_info or chroma_peek_collection. It explicitly mentions pagination support, which adds precision beyond just listing.

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

Usage Guidelines4/5

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

The description implies usage for retrieving collection names with pagination, but does not explicitly state when to use this tool versus alternatives like chroma_get_collection_count or chroma_get_collection_info. It provides clear context but lacks explicit exclusions or named alternatives.

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