Skip to main content
Glama
InditexTech

MCP Microsoft Teams Server

by InditexTech

get_member_by_name

Retrieve a Microsoft Teams member's details by providing their name. Find user information directly without browsing the member list.

Instructions

Get a member by its name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesMember name

Implementation Reference

  • The MCP tool handler function 'get_member_by_name' that receives the context and name parameter, then delegates to the TeamsClient.
    @mcp.tool(name="get_member_by_name", description="Get a member by its name")
    async def get_member_by_name(
        ctx: Context, name: str = Field(description="Member name")
    ):
        await ctx.debug(f"get_member_by_name with name={name}")
        client = _get_teams_client(ctx)
        return await client.get_member_by_name(name)
  • The TeamsClient.get_member_by_name method that fetches all members and filters by name.
    async def get_member_by_name(self, name: str) -> TeamsMember | None:
        members = await self.list_members()
        for member in members:
            if member.name == name:
                return member
        return None
  • The TeamsMember Pydantic model used as the return type for get_member_by_name.
    class TeamsMember(BaseModel):
        name: str = Field(
            description="Member name used in mentions and user information cards"
        )
        email: str = Field(description="Member email")
  • The list_members helper called by get_member_by_name to retrieve all team members.
    async def list_members(self) -> list[TeamsMember]:
        """List all members in the configured team.
    
        Returns:
            List of team member details
        """
        try:
            await self._initialize()
            result = []
    
            async def list_members_callback(context: TurnContext):
                continuation_token = ""
                try:
                    members = await TeamsInfo.get_paged_team_members(
                        context, self.teams_channel_id, 10, continuation_token
                    )
                    for member in members.members:
                        result.append(TeamsMember(name=member.name, email=member.email))
                except Exception as e:
                    LOGGER.error(f"Error getting members: {str(e)}")
    
            await self.adapter.continue_conversation(
                agent_app_id=self.teams_app_id,
                continuation_activity=self._create_continuation_activity(),
                callback=list_members_callback,
            )
            return result
        except Exception as e:
            LOGGER.error(f"Error listing members: {str(e)}")
            raise
  • The @mcp.tool decorator registering 'get_member_by_name' as an MCP tool.
    @mcp.tool(name="get_member_by_name", description="Get a member by its 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. It mentions 'Get' implying a read operation, but does not disclose important behaviors such as case sensitivity, exact vs partial matching, error handling (e.g., if member not found), or whether it returns null or throws an error.

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?

The description is a single concise sentence with no unnecessary words. It is appropriately front-loaded. However, it could be expanded slightly (e.g., noting exact match requirement) without harming conciseness.

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?

The tool is simple with one required parameter and no output schema. The description conveys the core action and parameter, but lacks information on return value, error states, or response format. For a simple retrieval, it is minimally 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 coverage is 100%: the 'name' parameter is described as 'Member name' in the schema. The description adds no additional context beyond that, so the baseline score of 3 applies.

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 'Get a member by its name' clearly states the verb and resource. It implies a specific lookup by name, distinguishing from the sibling 'list_members' which likely returns all members. However, it does not explicitly differentiate itself or mention that it is a single-member 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?

No guidance is provided on when to use this tool versus alternatives like 'list_members' or other sibling tools. There are no when-to-use, when-not-to-use, or prerequisite details, leaving the agent to infer usage 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/InditexTech/mcp-teams-server'

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