Skip to main content
Glama

get-current-user-teams

Retrieve a list of teams the current user is part of using this tool, enabling quick access to Shortcut project management data via the MCP server API.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'users-get-current-teams' tool using server.addToolWithReadAccess, which matches the requested tool name closely.
    "users-get-current-teams", "Get a list of teams where the current user is a member", async () => await tools.getCurrentUserTeams(), );
  • Handler function that implements the logic to get teams the current user belongs to by filtering client's getTeams based on current user's ID.
    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"), ); }

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