Skip to main content
Glama
InditexTech

MCP Microsoft Teams Server

by InditexTech

read_thread

Fetch all replies in a Microsoft Teams thread by providing its thread ID. Use this to access full threaded conversation details.

Instructions

Read replies in a thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idYesThe thread ID as a string in the format '1743086901347'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorYesCursor to retrieve the next page of messages.
limitYesPage limit, maximum number of items to retrieve
totalYesTotal items available for retrieval
itemsYesList of channel messages or threads

Implementation Reference

  • MCP tool handler for 'read_thread' - decorated with @mcp.tool, calls client.read_thread_replies(thread_id, 50)
    @mcp.tool(name="read_thread", description="Read replies in a thread")
    async def read_thread(
        ctx: Context,
        thread_id: str = Field(
            description="The thread ID as a string in the format '1743086901347'"
        ),
    ) -> PagedTeamsMessages:
        await ctx.debug(f"read_thread with thread_id={thread_id}")
        client = _get_teams_client(ctx)
        return await client.read_thread_replies(thread_id, 50)
  • TeamsClient.read_thread_replies() - the actual implementation that fetches thread replies via Microsoft Graph API with pagination support
    async def read_thread_replies(
        self, thread_id: str, limit: int = 50, cursor: str | None = None
    ) -> PagedTeamsMessages:
        """Read all replies in a thread.
    
        Args:
            thread_id: Thread ID to read
            cursor: The pagination cursor
            limit: The pagination page size
    
        Returns:
            List of thread messages
        """
        try:
            params = RepliesRequestBuilder.RepliesRequestBuilderGetQueryParameters(
                top=limit
            )
            request = RequestConfiguration(query_parameters=params)
    
            if cursor is not None:
                replies = (
                    await self.graph_client.teams.by_team_id(self.team_id)
                    .channels.by_channel_id(self.teams_channel_id)
                    .messages.by_chat_message_id(thread_id)
                    .replies.with_url(cursor)
                    .get(request_configuration=request)
                )
            else:
                replies = (
                    await self.graph_client.teams.by_team_id(self.team_id)
                    .channels.by_channel_id(self.teams_channel_id)
                    .messages.by_chat_message_id(thread_id)
                    .replies.get(request_configuration=request)
                )
    
            result = PagedTeamsMessages(
                cursor=cursor,
                limit=limit,
                total=replies.odata_count,  # pyright: ignore
                items=[],
            )
    
            if replies is not None and replies.value is not None:
                for reply in replies.value:
                    result.items.append(
                        TeamsMessage(
                            message_id=reply.id,  # pyright: ignore
                            content=reply.body.content,  # pyright: ignore
                            thread_id=reply.reply_to_id,  # pyright: ignore
                        )
                    )
    
            return result
        except Exception as e:
            LOGGER.error(f"Error reading thread: {str(e)}")
            raise
  • Tool registration via @mcp.tool(name='read_thread', description='Read replies in a thread') decorator
    @mcp.tool(name="read_thread", description="Read replies in a thread")
  • Input schema - thread_id parameter typed as str with Field description
    ctx: Context,
    thread_id: str = Field(
        description="The thread ID as a string in the format '1743086901347'"
    ),
Behavior2/5

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

With no annotations, the description carries full burden but only states 'Read replies', not disclosing traits like read-only nature (implied) or side effects.

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?

Extremely concise single sentence, no wasted words, but could be slightly expanded with context.

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 output schema exists, return values are covered. However, lacks guidance on distinguishing from siblings, making it just adequate.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter, so baseline 3; the description adds no additional meaning beyond the 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 'Read replies in a thread' uses a specific verb and resource, clearly distinguishing it from siblings like list_threads and start_thread.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. Usage is implied but not clarified, e.g., no mention of differences from list_threads.

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/InditexTech/mcp-teams-server'

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