Skip to main content
Glama
chroma-core

Chroma MCP Server

Official
by chroma-core

chroma_peek_collection

Inspect documents within a specified Chroma collection by specifying the collection name and desired document limit. Enables quick viewing of data stored in the database.

Instructions

Peek at documents in a Chroma collection.

Args:
    collection_name: Name of the collection to peek into
    limit: Number of documents to peek at

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_nameYes
limitNo

Implementation Reference

  • The handler function for 'chroma_peek_collection' tool. Decorated with @mcp.tool() for registration. Fetches the Chroma client, gets the collection by name, peeks at up to 'limit' documents, and returns the results.
    @mcp.tool()
    async def chroma_peek_collection(
        collection_name: str,
        limit: int = 5
    ) -> Dict:
        """Peek at documents in a Chroma collection.
        
        Args:
            collection_name: Name of the collection to peek into
            limit: Number of documents to peek at
        """
        client = get_chroma_client()
        try:
            collection = client.get_collection(collection_name)
            results = collection.peek(limit=limit)
            return results
        except Exception as e:
            raise Exception(f"Failed to peek collection '{collection_name}': {str(e)}") from e
  • The @mcp.tool() decorator registers the 'chroma_peek_collection' function as an MCP tool.
    @mcp.tool()
  • Input schema defined by function parameters (collection_name: str, limit: int=5) and docstring. Output is Dict from Chroma peek().
    async def chroma_peek_collection(
        collection_name: str,
        limit: int = 5
    ) -> Dict:
        """Peek at documents in a Chroma collection.
        
        Args:
            collection_name: Name of the collection to peek into
            limit: Number of documents to peek at

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are present, and the description does not disclose any behavioral traits beyond 'peek at documents'. It does not mention side effects, rate limits, authentication requirements, or what happens if the collection is empty or doesn't exist.

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 clear purpose sentence followed by structured parameter descriptions. Every sentence serves a purpose; no unnecessary words.

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?

For a simple tool with only 2 parameters and no output schema, the description covers the basic functionality and parameters. However, it lacks details about the return format or behavior in edge cases, which would be helpful but not critical for such a straightforward operation.

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?

The description adds meaningful information for both parameters: collection_name is described as 'Name of the collection to peek into' and limit as 'Number of documents to peek at'. Since schema description coverage is 0%, this provides necessary clarity beyond the schema's titles.

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 states 'Peek at documents in a Chroma collection', which clearly indicates a read operation on a collection. However, it does not distinguish from sibling tools like chroma_get_documents or chroma_query_documents, which also retrieve documents.

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 is provided on when to use this tool over alternatives. There is no mention of use cases, prerequisites, or when not to use it.

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