Skip to main content
Glama

lokalise_remove_members_from_group

Remove users from a user group to revoke group-based permissions and project access. Use for role changes, offboarding, or permission cleanup.

Instructions

Removes users from a user group, revoking group-based permissions and project access. Required: teamId, groupId, userIds array. Use for role changes, offboarding, or permission cleanup. Returns: Operation confirmation. Warning: Immediate effect - users lose group permissions and project access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamIdYesTeam ID containing the user group
groupIdYesUser group ID
userIdsYesUser IDs to remove from the group

Implementation Reference

  • Registration of the 'lokalise_remove_members_from_group' tool with server.tool(), binding RemoveMembersToolArgs.shape schema and handleRemoveMembers handler.
    server.tool(
    	"lokalise_remove_members_from_group",
    	"Removes users from a user group, revoking group-based permissions and project access. Required: teamId, groupId, userIds array. Use for role changes, offboarding, or permission cleanup. Returns: Operation confirmation. Warning: Immediate effect - users lose group permissions and project access.",
    	RemoveMembersToolArgs.shape,
    	handleRemoveMembers,
    );
  • Handler function 'handleRemoveMembers' that calls usergroupsController.removeMembers() and returns the result in MCP content format.
    async function handleRemoveMembers(args: RemoveMembersToolArgsType) {
    	const methodLogger = Logger.forContext(
    		"usergroups.tool.ts",
    		"handleRemoveMembers",
    	);
    	methodLogger.debug("Removing members from user group...", args);
    
    	try {
    		const result = await usergroupsController.removeMembers(args);
    		methodLogger.debug("Got the response from the controller", result);
    
    		return {
    			content: [
    				{
    					type: "text" as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error("Tool failed", {
    			error: (error as Error).message,
    			args,
    		});
    		return formatErrorForMcpTool(error);
    	}
    }
  • Zod schema 'RemoveMembersToolArgs' defining the tool's input arguments: teamId (string), groupId (string|number), userIds (array of string|number, min 1). Also the inferred type.
    /**
     * Zod schema for remove members from group tool arguments.
     */
    export const RemoveMembersToolArgs = z
    	.object({
    		teamId: z.string().describe("Team ID containing the user group"),
    		groupId: z.union([z.string(), z.number()]).describe("User group ID"),
    		userIds: z
    			.array(z.union([z.string(), z.number()]))
    			.min(1)
    			.describe("User IDs to remove from the group"),
    	})
    	.strict();
    
    export type RemoveMembersToolArgsType = z.infer<typeof RemoveMembersToolArgs>;
  • Controller function 'removeMembers' that validates inputs, calls service layer, and formats response via formatRemoveMembersResult formatter.
    /**
     * Remove members from a user group
     */
    async function removeMembers(
    	args: RemoveMembersToolArgsType,
    ): Promise<ControllerResponse> {
    	const methodLogger = Logger.forContext(
    		"usergroups.controller.ts",
    		"removeMembers",
    	);
    	methodLogger.debug("Removing members from user group...", args);
    
    	try {
    		// Validate inputs
    		if (!args.teamId) {
    			throw new McpError("Team ID is required.", ErrorType.API_ERROR);
    		}
    
    		if (!args.groupId) {
    			throw new McpError("Group ID is required.", ErrorType.API_ERROR);
    		}
    
    		if (!args.userIds || args.userIds.length === 0) {
    			throw new McpError(
    				"At least one user ID is required.",
    				ErrorType.API_ERROR,
    			);
    		}
    
    		// Call service layer
    		const result = await usergroupsService.removeMembers(args);
    
    		// Format response
    		const formattedContent = formatRemoveMembersResult(
    			result,
    			args.userIds.length,
    		);
    
    		methodLogger.debug("Members removed successfully", {
    			teamId: args.teamId,
    			groupId: args.groupId,
    			userCount: args.userIds.length,
    		});
    
    		return {
    			content: formattedContent,
    		};
    	} catch (error: unknown) {
    		throw handleControllerError(error, {
    			source: "UsergroupsController.removeMembers",
    			entityType: "UserGroup",
    			entityId: String(args.groupId),
    			operation: "removing members",
    		});
    	}
    }
  • Service function 'removeMembers' that calls the Lokalise API userGroups().remove_members_from_group() to actually perform the removal.
    async removeMembers(args: RemoveMembersToolArgsType): Promise<UserGroup> {
    	const methodLogger = logger.forMethod("removeMembers");
    	methodLogger.info("Removing members from user group", {
    		teamId: args.teamId,
    		groupId: args.groupId,
    		userCount: args.userIds.length,
    	});
    
    	try {
    		const api = getLokaliseApi();
    		// Convert user IDs to proper array type for SDK
    		const userIds = args.userIds.map((id) =>
    			typeof id === "string" ? id : id.toString(),
    		);
    		const result = await api
    			.userGroups()
    			.remove_members_from_group(args.teamId, args.groupId, userIds);
    
    		methodLogger.info("Removed members from user group successfully", {
    			teamId: args.teamId,
    			groupId: args.groupId,
    			removedCount: args.userIds.length,
    		});
    
    		return result;
    	} catch (error) {
    		methodLogger.error("Failed to remove members from user group", {
    			error,
    			args,
    		});
    		throw createUnexpectedError(
    			`Failed to remove members from user group ${args.groupId}`,
    			error,
    		);
    	}
    },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Warns of immediate effect and permission revocation. No annotations exist, so the description carries full burden; it adequately discloses consequences and return type.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences: action, requirements, use cases, return, warning. Front-loaded and efficient with no redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, required params, use cases, return value, and warning. No output schema needed; description is complete for this simple mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for each parameter. The description reiterates required parameters but adds no new semantic information beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool removes users from a user group, with specific verbs 'Removes' and 'revoking', and distinguishes from siblings like add_members_to_group and remove_projects_from_group.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lists use cases: 'Use for role changes, offboarding, or permission cleanup.' Does not provide negative use cases, but context is clear with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AbdallahAHO/lokalise-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server