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
| Name | Required | Description | Default |
|---|---|---|---|
| user_gid | Yes | The user GID to get teams for. Use 'me' to get teams for the current user. | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:446-452 (handler)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) }], }; }
- src/tools/user-tools.ts:3-20 (schema)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"] } };
- src/tool-handler.ts:51-53 (registration)Imports the getTeamsForUserTool for registration in the MCP tools list.getTeamsForUserTool, getTeamsForWorkspaceTool, getUsersForWorkspaceTool
- src/tool-handler.ts:95-95 (registration)Registers getTeamsForUserTool in the exported tools array.getTeamsForUserTool,
- src/asana-client-wrapper.ts:669-677 (helper)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; } }