Skip to main content
Glama

list_team_members

Retrieve all members of a Microsoft Team with their names, email addresses, roles, and IDs for team management and collaboration oversight.

Instructions

List all members of a specific Microsoft Team. Returns member names, email addresses, roles, and IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamIdYesTeam ID

Implementation Reference

  • The main handler function that fetches and returns the list of team members using the Microsoft Graph API for the specified teamId. Maps the response to MemberSummary format and handles errors.
    async ({ teamId }) => {
      try {
        const client = await graphService.getClient();
        const response = (await client
          .api(`/teams/${teamId}/members`)
          .get()) as GraphApiResponse<ConversationMember>;
    
        if (!response?.value?.length) {
          return {
            content: [
              {
                type: "text",
                text: "No members found in this team.",
              },
            ],
          };
        }
    
        const memberList: MemberSummary[] = response.value.map((member: ConversationMember) => ({
          id: member.id,
          displayName: member.displayName,
          roles: member.roles,
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(memberList, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
        return {
          content: [
            {
              type: "text",
              text: `❌ Error: ${errorMessage}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameter 'teamId' for the list_team_members tool.
      teamId: z.string().describe("Team ID"),
    },
  • The MCP server.tool registration call that registers the 'list_team_members' tool, including its description, input schema, and handler function.
      "list_team_members",
      "List all members of a specific Microsoft Team. Returns member names, email addresses, roles, and IDs.",
      {
        teamId: z.string().describe("Team ID"),
      },
      async ({ teamId }) => {
        try {
          const client = await graphService.getClient();
          const response = (await client
            .api(`/teams/${teamId}/members`)
            .get()) as GraphApiResponse<ConversationMember>;
    
          if (!response?.value?.length) {
            return {
              content: [
                {
                  type: "text",
                  text: "No members found in this team.",
                },
              ],
            };
          }
    
          const memberList: MemberSummary[] = response.value.map((member: ConversationMember) => ({
            id: member.id,
            displayName: member.displayName,
            roles: member.roles,
          }));
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(memberList, null, 2),
              },
            ],
          };
        } catch (error: unknown) {
          const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
          return {
            content: [
              {
                type: "text",
                text: `❌ Error: ${errorMessage}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the return fields (names, emails, roles, IDs), which is helpful, but doesn't cover critical aspects like pagination, rate limits, authentication requirements, or error conditions. For a list operation with zero annotation coverage, this leaves significant gaps in understanding tool behavior.

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 front-loads the core action ('List all members') and includes key return details. Every word earns its place with no redundancy or fluff, making it highly concise and well-structured.

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 the tool's moderate complexity (list operation with one parameter) and no output schema, the description is minimally adequate. It covers the purpose and return fields but lacks behavioral context (e.g., pagination) and usage guidelines. With no annotations to fill gaps, it's complete enough for basic use but leaves the agent guessing about finer details.

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?

The schema description coverage is 100% (teamId is fully described as 'Team ID'), so the baseline is 3. The description adds no additional parameter information beyond what the schema provides, such as format examples or sourcing details for teamId, but it doesn't need to compensate for gaps.

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 verb 'List' and resource 'members of a specific Microsoft Team', making the purpose unambiguous. It distinguishes from siblings like list_channels or list_teams by specifying team members. However, it doesn't explicitly differentiate from search_users or get_user, which could also retrieve user information, so it's not a perfect 5.

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 like search_users or get_user, which might retrieve similar user data. It doesn't mention prerequisites (e.g., needing team access) or exclusions, leaving the agent to infer usage from context alone.

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

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