remove_workspace_member
Removes a user from a workspace, revoking their workspace access without deleting the user from the organization.
Instructions
Remove a user from a workspace and revoke workspace access. This does not delete the user from the organization; use delete_user for full removal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | The workspace ID | |
| user_id | Yes | The user ID to remove |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- The `removeWorkspaceMember` method in WorkspacesService that performs the actual HTTP DELETE call to /admin/workspaces/{workspaceId}/users/{userId} to remove a user from a workspace.
async removeWorkspaceMember( workspaceId: string, userId: string, ): Promise<{ success: boolean }> { await this.delete( `/admin/workspaces/${this.encodePathSegment(workspaceId)}/users/${this.encodePathSegment(userId)}`, ); return { success: true }; } - src/tools/workspaces.tools.ts:95-98 (schema)The Zod schema for `removeWorkspaceMember` tool input, defining `workspace_id` (string) and `user_id` (string) parameters.
removeWorkspaceMember: { workspace_id: z.string().describe("The workspace ID"), user_id: z.string().describe("The user ID to remove"), }, - src/tools/workspaces.tools.ts:434-460 (registration)MCP tool registration via `server.tool('remove_workspace_member', ...)` within the `registerWorkspacesTools` function. Includes the handler that calls `service.workspaces.removeWorkspaceMember`.
// Phase 1: Remove workspace member tool server.tool( "remove_workspace_member", "Remove a user from a workspace and revoke workspace access. This does not delete the user from the organization; use delete_user for full removal.", WORKSPACES_TOOL_SCHEMAS.removeWorkspaceMember, async (params) => { await service.workspaces.removeWorkspaceMember( params.workspace_id, params.user_id, ); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully removed user from workspace`, success: true, }, null, 2, ), }, ], }; }, );