remove_role_from_team
Remove security role assignments from teams to revoke permissions when access levels need adjustment or during team restructuring.
Instructions
Removes a security role assignment from a team, revoking the permissions granted by that role for all team members. Use this when teams no longer need certain access levels or when restructuring team permissions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roleId | Yes | ID of the role to remove | |
| teamId | Yes | ID of the team to remove the role from |
Implementation Reference
- src/tools/role-tools.ts:630-653 (handler)The asynchronous handler function that executes the tool logic: deletes the team-role association using the Dataverse client's delete method on the association reference.async (params) => { try { await client.delete(`teams(${params.teamId})/teamroles_association(${params.roleId})/$ref`); return { content: [ { type: "text", text: `Successfully removed role from team.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error removing role from team: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/role-tools.ts:625-628 (schema)Zod input schema defining the required parameters: roleId and teamId as strings.inputSchema: { roleId: z.string().describe("ID of the role to remove"), teamId: z.string().describe("ID of the team to remove the role from") }
- src/tools/role-tools.ts:620-654 (registration)The MCP server.registerTool call that registers the 'remove_role_from_team' tool, including name, schema, title, description, and handler.server.registerTool( "remove_role_from_team", { title: "Remove Role from Team", description: "Removes a security role assignment from a team, revoking the permissions granted by that role for all team members. Use this when teams no longer need certain access levels or when restructuring team permissions.", inputSchema: { roleId: z.string().describe("ID of the role to remove"), teamId: z.string().describe("ID of the team to remove the role from") } }, async (params) => { try { await client.delete(`teams(${params.teamId})/teamroles_association(${params.roleId})/$ref`); return { content: [ { type: "text", text: `Successfully removed role from team.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error removing role from team: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/index.ts:196-196 (registration)Top-level invocation of the removeRoleFromTeamTool function, which performs the actual tool registration on the main MCP server instance.removeRoleFromTeamTool(server, dataverseClient);