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 () => {

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