Skip to main content
Glama

list_channels

Retrieve all indexed Slack channels with their document counts to identify available conversation data for search and analysis.

Instructions

List all indexed channels and their document counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:247-269 (registration)
    The @mcp.tool() decorator registers the list_channels function as an MCP tool. This is the registration point where the tool is exposed through the MCP server.
    @mcp.tool()
    def list_channels() -> dict:
        """List all indexed channels and their document counts."""
        store = _get_store()
        all_docs = store.get(include=["metadatas"])
    
        channels: Dict[str, Dict] = {}
        for meta in all_docs["metadatas"]:
            name = meta.get("channel_name", "unknown")
            if name not in channels:
                channels[name] = {
                    "channel_id": meta.get("channel_id", ""),
                    "total_docs": 0,
                    "threads": 0,
                    "links": 0,
                }
            channels[name]["total_docs"] += 1
            if meta.get("source") == "slack_thread":
                channels[name]["threads"] += 1
            else:
                channels[name]["links"] += 1
    
        return {"channels": channels, "total_documents": store.count()}
  • The list_channels function is the main handler that executes the tool logic. It retrieves all documents from the vector store, aggregates them by channel name, and returns channel statistics including document counts, thread counts, and link counts.
    def list_channels() -> dict:
        """List all indexed channels and their document counts."""
        store = _get_store()
        all_docs = store.get(include=["metadatas"])
    
        channels: Dict[str, Dict] = {}
        for meta in all_docs["metadatas"]:
            name = meta.get("channel_name", "unknown")
            if name not in channels:
                channels[name] = {
                    "channel_id": meta.get("channel_id", ""),
                    "total_docs": 0,
                    "threads": 0,
                    "links": 0,
                }
            channels[name]["total_docs"] += 1
            if meta.get("source") == "slack_thread":
                channels[name]["threads"] += 1
            else:
                channels[name]["links"] += 1
    
        return {"channels": channels, "total_documents": store.count()}
  • The _get_store() helper function lazily initializes and returns a QdrantVectorStore instance. This is used by the list_channels handler to access the indexed Slack data.
    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?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool returns but doesn't address important behavioral aspects like whether results are paginated, sorted, filtered, or if there are rate limits. 'List all' suggests comprehensive retrieval but lacks operational details.

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, efficient sentence that communicates the core functionality without unnecessary words. It's front-loaded with the main action and includes the key output detail (document counts). Every word serves a purpose.

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 zero-parameter list tool with no annotations and no output schema, the description provides basic purpose but lacks important context. It doesn't explain the return format, what 'indexed' means operationally, or how results are structured. The absence of output schema increases the need for return value description.

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 zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't waste space discussing non-existent parameters, maintaining focus on the tool's purpose.

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 verb ('List') and resource ('indexed channels'), and specifies what information is returned ('their document counts'). It doesn't explicitly differentiate from sibling tools like 'list_users' or 'collection_stats', but the resource specificity provides reasonable distinction.

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 about when to use this tool versus alternatives like 'collection_stats' or 'search'. The description implies this is for getting a comprehensive list of channels with document counts, but doesn't specify use cases, prerequisites, or exclusions.

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