Skip to main content
Glama

lokalise_remove_projects_from_group

Remove specified projects from a user group to revoke team member access, limit project scope, or restructure permissions. All group members lose immediate access to those projects.

Instructions

Removes projects from a user group, revoking group member access to specified projects. Required: teamId, groupId, projectIds array. Use to limit project scope, offboard projects, or restructure access. Returns: Operation confirmation. Warning: All group members lose immediate project access.

Input Schema

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

Implementation Reference

  • Handler function for the 'lokalise_remove_projects_from_group' tool. Calls usergroupsController.removeProjects and formats the response.
    async function handleRemoveProjects(args: RemoveProjectsToolArgsType) {
    	const methodLogger = Logger.forContext(
    		"usergroups.tool.ts",
    		"handleRemoveProjects",
    	);
    	methodLogger.debug("Removing projects from user group...", args);
    
    	try {
    		const result = await usergroupsController.removeProjects(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 defining the input arguments: teamId (string), groupId (string|number), projectIds (array of string|number, min 1).
    export const RemoveProjectsToolArgs = z
    	.object({
    		teamId: z.string().describe("Team ID containing the user group"),
    		groupId: z.union([z.string(), z.number()]).describe("User group ID"),
    		projectIds: z
    			.array(z.union([z.string(), z.number()]))
    			.min(1)
    			.describe("Project IDs to remove from the group"),
    	})
    	.strict();
    
    export type RemoveProjectsToolArgsType = z.infer<typeof RemoveProjectsToolArgs>;
  • Registers the tool on the MCP server with name 'lokalise_remove_projects_from_group', description, schema, and handler.
    server.tool(
    	"lokalise_remove_projects_from_group",
    	"Removes projects from a user group, revoking group member access to specified projects. Required: teamId, groupId, projectIds array. Use to limit project scope, offboard projects, or restructure access. Returns: Operation confirmation. Warning: All group members lose immediate project access.",
    	RemoveProjectsToolArgs.shape,
    	handleRemoveProjects,
    );
  • Controller that validates inputs and delegates to usergroupsService.removeProjects, then formats via formatRemoveProjectsResult.
    /**
     * Remove projects from a user group
     */
    async function removeProjects(
    	args: RemoveProjectsToolArgsType,
    ): Promise<ControllerResponse> {
    	const methodLogger = Logger.forContext(
    		"usergroups.controller.ts",
    		"removeProjects",
    	);
    	methodLogger.debug("Removing projects 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.projectIds || args.projectIds.length === 0) {
    			throw new McpError(
    				"At least one project ID is required.",
    				ErrorType.API_ERROR,
    			);
    		}
    
    		// Call service layer
    		const result = await usergroupsService.removeProjects(args);
    
    		// Format response
    		const formattedContent = formatRemoveProjectsResult(
    			result,
    			args.projectIds.length,
    		);
    
    		methodLogger.debug("Projects removed successfully", {
    			teamId: args.teamId,
    			groupId: args.groupId,
    			projectCount: args.projectIds.length,
    		});
    
    		return {
    			content: formattedContent,
    		};
    	} catch (error: unknown) {
    		throw handleControllerError(error, {
    			source: "UsergroupsController.removeProjects",
    			entityType: "UserGroup",
    			entityId: String(args.groupId),
    			operation: "removing projects",
    		});
    	}
    }
  • Service layer that calls the Lokalise API client userGroups().remove_projects_from_group(teamId, groupId, projectIds).
    async removeProjects(args: RemoveProjectsToolArgsType): Promise<UserGroup> {
    	const methodLogger = logger.forMethod("removeProjects");
    	methodLogger.info("Removing projects from user group", {
    		teamId: args.teamId,
    		groupId: args.groupId,
    		projectCount: args.projectIds.length,
    	});
    
    	try {
    		const api = getLokaliseApi();
    		// Convert project IDs to proper array type for SDK
    		const projectIds = args.projectIds.map((id) =>
    			typeof id === "string" ? id : id.toString(),
    		);
    		const result = await api
    			.userGroups()
    			.remove_projects_from_group(args.teamId, args.groupId, projectIds);
    
    		methodLogger.info("Removed projects from user group successfully", {
    			teamId: args.teamId,
    			groupId: args.groupId,
    			removedCount: args.projectIds.length,
    		});
    
    		return result;
    	} catch (error) {
    		methodLogger.error("Failed to remove projects from user group", {
    			error,
    			args,
    		});
    		throw createUnexpectedError(
    			`Failed to remove projects from user group ${args.groupId}`,
    			error,
    		);
    	}
    },
Behavior4/5

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

With no annotations, the description discloses a key behavioral trait: 'All group members lose immediate project access.' This warning adds value beyond the core action. It could further detail permission requirements or reversal possibilities, but the warning is sufficient.

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

Conciseness4/5

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

The description is brief (three sentences plus separate lines for returns and warning). Information is front-loaded: first sentence states purpose, second lists required params. The 'Required:' line is redundant with the schema but aids quick scanning.

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

Completeness4/5

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

Given 3 required params and no output schema, the description includes a return type note and a warning about immediate access loss. It does not explain the relationship to the sibling 'add_projects_to_group' tool, but the information provided is sufficient for a simple removal operation.

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%, so baseline is 3. The description repeats required parameter names but does not add new semantic meaning beyond the schema descriptions. The use case list provides context for the action but not for individual parameters.

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 action ('Removes projects from a user group') and its effect ('revoking group member access to specified projects'). It distinguishes from sibling tools like 'lokalise_add_projects_to_group' and 'lokalise_remove_members_from_group' by specifying the resource (projects) and the target (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?

The description provides explicit use cases ('limit project scope, offboard projects, or restructure access') and lists required parameters. However, it does not explicitly state when not to use this tool or mention alternatives like 'lokalise_add_projects_to_group' as the reverse operation.

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