Skip to main content
Glama

get_thread

Retrieve complete Slack thread content and linked resources using a thread timestamp, providing full context after search results.

Instructions

Retrieve all chunks for a specific Slack thread, including any linked resources.

Use this after search() to get the full thread context.

Args: thread_ts: The thread timestamp (from search result metadata). channel_id: Optional channel ID to narrow the lookup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_tsYes
channel_idNo

Implementation Reference

  • The complete handler implementation for the get_thread tool. It retrieves all chunks for a specific Slack thread from the vector store, separates thread chunks from linked resources, sorts them, and returns them organized in a structured response.
    @mcp.tool()
    def get_thread(thread_ts: str, channel_id: str | None = None) -> dict:
        """Retrieve all chunks for a specific Slack thread, including any linked resources.
    
        Use this after search() to get the full thread context.
    
        Args:
            thread_ts: The thread timestamp (from search result metadata).
            channel_id: Optional channel ID to narrow the lookup.
        """
        store = _get_store()
        where: Dict[str, Any] = {"thread_ts": thread_ts}
        if channel_id:
            where = {"$and": [{"thread_ts": thread_ts}, {"channel_id": channel_id}]}
    
        results = store.get(where=where, include=["documents", "metadatas"])
    
        thread_chunks = []
        link_chunks = []
    
        for doc_id, text, meta in zip(
            results["ids"], results["documents"], results["metadatas"]
        ):
            entry = {"id": doc_id, "text": text, "metadata": meta}
            if meta.get("source") == "slack_thread":
                thread_chunks.append(entry)
            else:
                link_chunks.append(entry)
    
        thread_chunks.sort(key=lambda x: x["metadata"].get("chunk_index", 0))
        link_chunks.sort(
            key=lambda x: (
                x["metadata"].get("url", ""),
                x["metadata"].get("chunk_index", 0),
            )
        )
    
        return {
            "thread_ts": thread_ts,
            "thread_chunks": thread_chunks,
            "linked_resources": link_chunks,
        }
  • Function signature and docstring defining the input schema for get_thread tool. Accepts thread_ts (required string) and channel_id (optional string), returns a dict with thread_chunks and linked_resources.
    def get_thread(thread_ts: str, channel_id: str | None = None) -> dict:
        """Retrieve all chunks for a specific Slack thread, including any linked resources.
    
        Use this after search() to get the full thread context.
    
        Args:
            thread_ts: The thread timestamp (from search result metadata).
            channel_id: Optional channel ID to narrow the lookup.
        """
  • server.py:203-204 (registration)
    The @mcp.tool() decorator registers the get_thread function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
    def get_thread(thread_ts: str, channel_id: str | None = None) -> dict:
Behavior3/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 mentions retrieving 'all chunks' and 'including any linked resources' which provides useful context about what data is returned. However, it doesn't mention potential limitations like rate limits, authentication requirements, or what happens when thread_ts is invalid.

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 efficiently structured with a purpose statement, usage guidance, and parameter explanations in just three sentences. Every sentence earns its place, and the information is front-loaded with the most important details first.

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 read operation with 2 parameters and no annotations or output schema, the description provides adequate but not complete context. It explains what the tool does and when to use it, but doesn't describe the return format, error conditions, or any behavioral constraints that would be helpful for an AI agent.

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?

With 0% schema description coverage, the description compensates well by explaining both parameters: 'thread_ts: The thread timestamp (from search result metadata)' and 'channel_id: Optional channel ID to narrow the lookup.' This adds meaningful context beyond what the bare schema provides about parameter purposes and sources.

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 tool's purpose with specific verbs ('retrieve all chunks') and resources ('for a specific Slack thread, including any linked resources'). It distinguishes itself from sibling tools like 'search' by specifying it's for getting full thread context after using search().

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'Use this after search() to get the full thread context.' This clearly positions it relative to the 'search' sibling tool and provides a specific workflow context.

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