add_members_to_team
Add users to a team to grant them access to team-owned records and team-based permissions, expanding membership for resource sharing.
Instructions
Adds users as members to a team, granting them access to team-owned records and team-based permissions. Use this to expand team membership and provide users with team-level access to resources.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memberIds | Yes | Array of user IDs to add as team members | |
| teamId | Yes | ID of the team to add members to |
Implementation Reference
- src/tools/team-tools.ts:362-401 (handler)Full implementation of the 'add_members_to_team' tool handler, including registration, input schema, and the core logic that invokes the Dataverse 'AddMembersTeam' action to add users to a team.export function addMembersToTeamTool(server: McpServer, client: DataverseClient) { server.registerTool( "add_members_to_team", { title: "Add Members to Team", description: "Adds users as members to a team, granting them access to team-owned records and team-based permissions. Use this to expand team membership and provide users with team-level access to resources.", inputSchema: { teamId: z.string().describe("ID of the team to add members to"), memberIds: z.array(z.string()).describe("Array of user IDs to add as team members") } }, async (params) => { try { await client.callAction('AddMembersTeam', { TeamId: params.teamId, MemberIds: params.memberIds }); return { content: [ { type: "text", text: `Successfully added ${params.memberIds.length} member(s) to team.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error adding members to team: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
- src/tools/team-tools.ts:365-372 (schema)Input schema definition for the 'add_members_to_team' tool using Zod, specifying teamId and array of memberIds.{ title: "Add Members to Team", description: "Adds users as members to a team, granting them access to team-owned records and team-based permissions. Use this to expand team membership and provide users with team-level access to resources.", inputSchema: { teamId: z.string().describe("ID of the team to add members to"), memberIds: z.array(z.string()).describe("Array of user IDs to add as team members") } },
- src/index.ts:206-206 (registration)Registration of the 'add_members_to_team' tool by calling the addMembersToTeamTool helper function with the MCP server and Dataverse client.addMembersToTeamTool(server, dataverseClient);
- src/index.ts:70-74 (helper)Import of the addMembersToTeamTool helper from team-tools.ts.addMembersToTeamTool, removeMembersFromTeamTool, getTeamMembersTool, convertOwnerTeamToAccessTeamTool } from "./tools/team-tools.js";