Skip to main content
Glama
InditexTech

MCP Microsoft Teams Server

by InditexTech

start_thread

Create and initiate a new discussion thread in Microsoft Teams with a specified title and content, optionally mentioning a member by name for direct engagement.

Instructions

Start a new thread with a given title and content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe thread content
member_nameNoMember name to mention in the thread
titleYesThe thread title

Implementation Reference

  • MCP tool handler function for 'start_thread', including input schema via Pydantic Fields, which delegates to TeamsClient.start_thread
    @mcp.tool(
        name="start_thread", description="Start a new thread with a given title and content"
    )
    async def start_thread(
        ctx: Context,
        title: str = Field(description="The thread title"),
        content: str = Field(description="The thread content"),
        member_name: str | None = Field(
            description="Member name to mention in the thread", default=None
        ),
    ) -> TeamsThread:
        await ctx.debug(f"start_thread with title={title} and content={content}")
        client = _get_teams_client(ctx)
        return await client.start_thread(title, content, member_name)
  • Core implementation of thread starting in TeamsClient, using BotFramework CloudAdapter to send an Activity with topic_name as title, optionally mentioning a member
    async def start_thread(
        self, title: str, content: str, member_name: str | None = None
    ) -> TeamsThread:
        """Start a new thread in a channel.
    
        Args:
            title: Thread title
            content: Initial thread content
            member_name: Member name to mention in content
    
        Returns:
            Created thread details including ID
        """
        try:
            await self._initialize()
    
            result = TeamsThread(title=title, content=content, thread_id="")
    
            async def start_thread_callback(context: TurnContext):
                mention_member = None
                if member_name is not None:
                    members = await TeamsInfo.get_team_members(context, self.team_id)
                    for member in members:
                        if member.name == member_name:
                            mention_member = member
    
                mentions = []
                if mention_member is not None:
                    result.content = (
                        f"# **{title}**\n<at>{mention_member.name}</at> {content}"
                    )
                    mention = Mention(
                        text=f"<at>{mention_member.name}</at>",
                        type="mention",
                        mentioned=ChannelAccount(
                            id=mention_member.id, name=mention_member.name
                        ),
                    )
                    mentions.append(mention)
    
                response = await context.send_activity(
                    activity_or_text=Activity(
                        type=ActivityTypes.message,
                        topic_name=title,
                        text=result.content,
                        text_format=TextFormatTypes.markdown,
                        entities=mentions,
                    )
                )
                if response is not None:
                    result.thread_id = response.id
    
            await self.adapter.continue_conversation(
                bot_app_id=self.teams_app_id,
                reference=self._create_conversation_reference(),
                callback=start_thread_callback,
            )
    
            return result
        except Exception as e:
            LOGGER.error(f"Error creating thread: {str(e)}")
            raise
  • Pydantic model for TeamsThread, used as return type for start_thread
    class TeamsThread(BaseModel):
        thread_id: str = Field(
            description="Thread ID as a string in the format '1743086901347'"
        )
        title: str = Field(description="Message title")
        content: str = Field(description="Message content")
  • The @mcp.tool decorator registers the start_thread handler with name='start_thread'
    @mcp.tool(
        name="start_thread", description="Start a new thread with a given title and content"
    )
    async def start_thread(
        ctx: Context,
        title: str = Field(description="The thread title"),
        content: str = Field(description="The thread content"),
        member_name: str | None = Field(
            description="Member name to mention in the thread", default=None
        ),
    ) -> TeamsThread:
        await ctx.debug(f"start_thread with title={title} and content={content}")
        client = _get_teams_client(ctx)
        return await client.start_thread(title, content, member_name)
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 action ('Start a new thread') but does not cover critical aspects like whether this requires authentication, what happens on success (e.g., returns a thread ID), error conditions, or rate limits. For a creation tool with zero annotation coverage, this is a significant gap.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a creation tool with no annotations and no output schema, the description is incomplete. It does not explain what the tool returns (e.g., a thread object or ID), error handling, or behavioral traits like permissions needed. This leaves the agent with insufficient information for reliable invocation.

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%, so the schema fully documents the three parameters (title, content, member_name) with descriptions. The description adds no additional meaning beyond implying that title and content are required, which is already clear from the schema. This meets the baseline for high schema coverage.

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 action ('Start a new thread') and the required resources ('with a given title and content'), making the purpose immediately understandable. However, it does not differentiate this tool from sibling tools like 'update_thread' or 'read_thread', which would require mentioning that this is for creation rather than modification or retrieval.

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. It does not mention prerequisites, such as needing to be in a specific context or having permissions, nor does it compare it to siblings like 'update_thread' for editing or 'list_threads' for viewing. This leaves the agent without context for tool selection.

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

Related 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