Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_teams_for_user

Retrieve teams accessible to a specific Asana user. Specify a user GID or use 'me' for current user to view team memberships and permissions.

Instructions

Get teams to which the user has access

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_gidYesThe user GID to get teams for. Use 'me' to get teams for the current user.
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

  • Executes the tool logic by calling AsanaClientWrapper.getTeamsForUser with user_gid and options, returning JSON stringified response.
    case "asana_get_teams_for_user": {
      const { user_gid, ...opts } = args;
      const response = await asanaClient.getTeamsForUser(user_gid, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Defines the tool's name, description, and input schema requiring user_gid and optionally opt_fields.
    export const getTeamsForUserTool: Tool = {
      name: "asana_get_teams_for_user",
      description: "Get teams to which the user has access",
      inputSchema: {
        type: "object",
        properties: {
          user_gid: {
            type: "string",
            description: "The user GID to get teams for. Use 'me' to get teams for the current user."
          },
          opt_fields: {
            type: "string",
            description: "Comma-separated list of optional fields to include"
          }
        },
        required: ["user_gid"]
      }
    };
  • Imports the getTeamsForUserTool for registration in the MCP tools list.
    getTeamsForUserTool,
    getTeamsForWorkspaceTool,
    getUsersForWorkspaceTool
  • Registers getTeamsForUserTool in the exported tools array.
    getTeamsForUserTool,
  • Supporting method in AsanaClientWrapper that wraps the Asana SDK TeamsApi.getTeamsForUser call.
    async getTeamsForUser(user_gid: string, opts: any = {}) {
      try {
        const response = await this.teams.getTeamsForUser(user_gid, opts);
        return response.data;
      } catch (error) {
        console.error(`Error in getTeamsForUser: ${error}`);
        throw error;
      }
    }

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/cristip73/mcp-server-asana'

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