Skip to main content
Glama
InditexTech

MCP Microsoft Teams Server

by InditexTech

start_thread

Create a new thread in Microsoft Teams with a specified title and content, and optionally mention a team member.

Instructions

Start a new thread with a given title and content

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idYesThread ID as a string in the format '1743086901347'
titleYesMessage title
contentYesMessage content

Implementation Reference

  • The core implementation of start_thread logic in TeamsClient. Creates a thread by sending an activity via the bot adapter, optionally mentioning a member. Returns a TeamsThread object with the created thread ID.
    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 = await self._get_mention_member(context, member_name)
    
                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>",
                        mentioned=ChannelAccount(
                            id=mention_member.id, name=mention_member.name
                        ),
                    )
                    mentions.append(mention)
    
                try:
                    activity = Activity(
                        type=ActivityTypes.message,
                        from_property=ChannelAccount( id=self.teams_app_id, name=MCP_BOT_NAME), # type: ignore
                        channel_id="msteams",  # type: ignore
                        conversation=context.activity.conversation,
                        topic_name=title,
                        text=result.content,
                        text_format=TextFormatTypes.markdown,
                        entities=mentions,
                    )
    
                    responses = await self.adapter.send_activities(context, [activity])
                    response = responses[0] if responses else None
    
                    if response is not None:
                        result.thread_id = response.id
                except Exception as ae:
                    LOGGER.exception(ae)
    
            await self.adapter.continue_conversation(
                agent_app_id=self.teams_app_id,
                continuation_activity=self._create_continuation_activity(),
                callback=start_thread_callback,
            )
    
            return result
        except Exception as e:
            LOGGER.error(f"Error creating thread: {str(e)}")
            raise
  • Registers the 'start_thread' MCP tool with FastMCP decorator. Extracts the TeamsClient from context and delegates to client.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)
  • The TeamsThread model returned by start_thread, containing thread_id, title, and content fields.
    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")
  • Input parameter schema for the start_thread MCP tool: title (str), content (str), and optional member_name (str | None).
    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:
  • Integration test for start_thread that exercises the TeamsClient.start_thread method with title, content, and a user mention.
    async def test_start_thread(setup_teams_client, user_name):
        LOGGER.info(
            f"test_start_thread in team: {setup_teams_client.team_id} "
            f"and channel {setup_teams_client.teams_channel_id}"
        )
        try:
            result = await setup_teams_client.start_thread(
                "First thread", "First thread content with mention", user_name
Behavior2/5

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

No annotations provided, so the description must disclose behavioral traits. It only states 'start' without mentioning side effects, permissions, or what happens to the thread after creation.

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?

Single sentence with precise wording. No wasted words, front-loaded action.

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?

Minimal but adequate for a simple creation tool with output schema. Lacks context on thread placement or relationship to sibling tools.

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 coverage is 100%, so the schema already describes parameters. The description adds no extra meaning beyond repeating title and content.

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 verb 'start' and the resource 'thread', with explicit inputs. It distinguishes from sibling tools like list_threads, read_thread, and update_thread.

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 on when to use this tool vs alternatives. No context about prerequisites, thread placement, or when not to use it.

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