Skip to main content
Glama

list_teams

Retrieve all Microsoft Teams you belong to, including team names, descriptions, and IDs, for managing your team memberships and accessing team information.

Instructions

List all Microsoft Teams that the current user is a member of. Returns team names, descriptions, and IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_teams' tool. It fetches the current user's joined Microsoft Teams using the Microsoft Graph API endpoint '/me/joinedTeams', maps the response to TeamSummary objects, and returns the list as JSON-formatted text content. Handles empty results and errors gracefully.
      try {
        const client = await graphService.getClient();
        const response = (await client.api("/me/joinedTeams").get()) as GraphApiResponse<Team>;
    
        if (!response?.value?.length) {
          return {
            content: [
              {
                type: "text",
                text: "No teams found.",
              },
            ],
          };
        }
    
        const teamList: TeamSummary[] = response.value.map((team: Team) => ({
          id: team.id,
          displayName: team.displayName,
          description: team.description,
          isArchived: team.isArchived,
        }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(teamList, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
        return {
          content: [
            {
              type: "text",
              text: `❌ Error: ${errorMessage}`,
            },
          ],
        };
      }
    }
  • Registration of the 'list_teams' tool using server.tool(). It has an empty input schema ({}), a descriptive name and description, and references the inline handler function.
      "list_teams",
      "List all Microsoft Teams that the current user is a member of. Returns team names, descriptions, and IDs.",
      {},
      async () => {
        try {
          const client = await graphService.getClient();
          const response = (await client.api("/me/joinedTeams").get()) as GraphApiResponse<Team>;
    
          if (!response?.value?.length) {
            return {
              content: [
                {
                  type: "text",
                  text: "No teams found.",
                },
              ],
            };
          }
    
          const teamList: TeamSummary[] = response.value.map((team: Team) => ({
            id: team.id,
            displayName: team.displayName,
            description: team.description,
            isArchived: team.isArchived,
          }));
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(teamList, null, 2),
              },
            ],
          };
        } catch (error: unknown) {
          const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
          return {
            content: [
              {
                type: "text",
                text: `❌ Error: ${errorMessage}`,
              },
            ],
          };
        }
      }
    );
  • Input schema for 'list_teams' tool, which is empty indicating no parameters are required.
    async () => {
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the return format (team names, descriptions, and IDs) and that it's a read operation, but lacks details on pagination, rate limits, authentication needs, or error conditions. It's adequate but minimal for behavioral context.

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?

Two sentences that are front-loaded with the core purpose and return values. Every word earns its place with no redundancy or fluff, making it highly efficient and easy to parse.

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

Completeness4/5

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

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is complete enough for a basic list operation. It covers purpose and return format, though it could benefit from more behavioral details like pagination or error handling to be fully comprehensive.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, which is appropriate. Baseline is 4 for zero parameters, as it avoids unnecessary details.

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 'List' and resource 'Microsoft Teams', specifies scope 'that the current user is a member of', and distinguishes from siblings like list_channels and list_chats by focusing on teams. It's specific and unambiguous.

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?

The description implies usage context (current user's membership) but doesn't explicitly state when to use this tool versus alternatives like list_channels or list_team_members. No guidance on prerequisites or exclusions is provided, leaving usage somewhat open to interpretation.

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