Skip to main content
Glama

collection_stats

Retrieve summary statistics about indexed Slack message collections to analyze data volume, distribution, and search readiness.

Instructions

Get summary statistics about the indexed collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The collection_stats tool handler function that retrieves and aggregates statistics about the indexed Slack collection. It queries all documents, counts by source type and channel, tracks unique threads, and returns summary statistics including total documents, unique threads, and breakdowns by source and channel.
    @mcp.tool()
    def collection_stats() -> dict:
        """Get summary statistics about the indexed collection."""
        store = _get_store()
        all_docs = store.get(include=["metadatas"])
    
        source_counts: Dict[str, int] = {}
        channel_counts: Dict[str, int] = {}
        unique_threads: set[str] = set()
    
        for meta in all_docs["metadatas"]:
            source = meta.get("source", "unknown")
            source_counts[source] = source_counts.get(source, 0) + 1
            channel = meta.get("channel_name", "unknown")
            channel_counts[channel] = channel_counts.get(channel, 0) + 1
            ts = meta.get("thread_ts")
            if ts:
                unique_threads.add(ts)
    
        return {
            "total_documents": store.count(),
            "unique_threads": len(unique_threads),
            "by_source": source_counts,
            "by_channel": channel_counts,
        }
  • server.py:272-272 (registration)
    The @mcp.tool() decorator registers the collection_stats function as an MCP tool, making it available for invocation by MCP clients.
    @mcp.tool()
  • server.py:50-53 (registration)
    FastMCP server initialization that creates the MCP server instance where all tools (including collection_stats) are registered.
    mcp = FastMCP(
        "slack-indexed",
        instructions="Search indexed Slack channel messages and linked resources (GitHub, Linear, Notion).",
    )
  • The _get_store() helper function provides lazy initialization of the QdrantVectorStore instance used by collection_stats to query the indexed collection.
    def _get_store() -> QdrantVectorStore:
        global _store
        if _store is None:
            _store = QdrantVectorStore(
                url=_qdrant_url,
                collection_name=_qdrant_collection,
                embedder=_get_embedder(),
                timeout=_qdrant_timeout,
                api_key=_qdrant_api_key,
            )
        return _store
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get[s] summary statistics', implying a read-only operation, but doesn't specify details like what data is included in the statistics, whether it's real-time or cached, or any performance considerations. This leaves significant gaps in understanding the tool's behavior.

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 a single, clear sentence that directly states the tool's function without any unnecessary words or fluff. It's front-loaded with the core purpose, making it efficient and easy to parse for an AI agent.

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 the tool has no parameters and no output schema, the description provides a basic understanding of what the tool does ('Get summary statistics'), but it lacks details on what the statistics include, format, or how they relate to the collection. For a tool with no structured data to rely on, this is a minimal viable description that leaves room for improvement in context.

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 tool has 0 parameters, and the schema description coverage is 100%, so there are no parameters to document. The description appropriately doesn't add parameter details, as none are needed, and it doesn't mislead by mentioning non-existent parameters. A baseline of 4 is applied since no parameters exist, and the description doesn't compensate for any gaps.

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 tool's purpose with a specific verb ('Get') and resource ('summary statistics about the indexed collection'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'search' or 'list_channels', which might also provide statistical or listing functions, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search' or 'list_channels'. It lacks context about what 'summary statistics' entail or when this is preferred over other data retrieval methods, leaving the agent to infer usage without explicit direction.

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

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/KanvaBhatia-Alaan/alaan-slack-indexed-mcp-tool'

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