Remove Role from Team
remove_role_from_teamRemove 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"roleId": "<roleId>",
"teamId": "<teamId>"
},
"name": "remove_role_from_team"
}
}Input 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);