Skip to main content
Glama

list_teams

Retrieve detailed information, including names, descriptions, and IDs, about all Microsoft Teams the user belongs to, facilitating efficient team management and collaboration.

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 user's joined teams from the Microsoft Graph API (/me/joinedTeams), maps the results to TeamSummary format (id, displayName, description, isArchived), and returns a JSON stringified list or error message as text content.
    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}`, }, ], }; } }
  • Registers the 'list_teams' tool using server.tool() with name, description, empty input schema ({}), and 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}`, }, ], }; } } );
  • src/index.ts:134-134 (registration)
    Top-level call to registerTeamsTools which includes the registration of the 'list_teams' tool among other teams tools.
    registerTeamsTools(server, graphService);

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