Skip to main content
Glama

users-get-current-teams

Retrieve a list of teams where the current user is a member within the Shortcut project management platform.

Instructions

Get a list of teams where the current user is a member

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'users-get-current-teams' tool. Fetches all teams and the current user via the ShortcutClientWrapper, filters for non-archived teams that include the current user as a member, and formats the result using base tool methods.
    async getCurrentUserTeams() { const teams = await this.client.getTeams(); const currentUser = await this.client.getCurrentUser(); if (!currentUser) throw new Error("Failed to get current user."); const userTeams = teams.filter( (team) => !team.archived && team.member_ids.includes(currentUser.id), ); if (!userTeams.length) return this.toResult(`Current user is not a member of any teams.`); if (userTeams.length === 1) { const team = userTeams[0]; return this.toResult( `Current user is a member of team "${team.name}":`, await this.entityWithRelatedEntities(team, "team"), ); } return this.toResult( `Current user is a member of ${userTeams.length} teams:`, await this.entitiesWithRelatedEntities(userTeams, "teams"), ); }
  • Registers the 'users-get-current-teams' tool with the CustomMcpServer using addToolWithReadAccess, providing the name, description, and handler reference.
    server.addToolWithReadAccess( "users-get-current-teams", "Get a list of teams where the current user is a member", async () => await tools.getCurrentUserTeams(), );

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/useshortcut/mcp-server-shortcut'

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