Skip to main content
Glama

lokalise_update_team_user

Update a team user's role (owner, admin, member, biller) to manage permissions and adjust access levels.

Instructions

Updates a team user's role (owner, admin, member, or biller). Required: teamId, userId, role. Use to manage permissions, promote/demote, or adjust access levels. Returns: Updated user profile with new role and permissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamIdYesTeam ID containing the user
userIdYesUser ID to update
roleYesNew role for the user

Implementation Reference

  • Registration of the 'lokalise_update_team_user' tool on the MCP server with description, schema (UpdateTeamusersToolArgs.shape), and handler (handleUpdateTeamusers).
    server.tool(
    	"lokalise_update_team_user",
    	"Updates a team user's role (owner, admin, member, or biller). Required: teamId, userId, role. Use to manage permissions, promote/demote, or adjust access levels. Returns: Updated user profile with new role and permissions.",
    	UpdateTeamusersToolArgs.shape,
    	handleUpdateTeamusers,
    );
  • Handler function 'handleUpdateTeamusers' that receives args (teamId, userId, role), calls teamusersController.updateTeamusers(), and formats the result for MCP response.
    /**
     * @function handleUpdateTeamusers
     * @description MCP Tool handler to update a teamusers's properties.
     *
     * @param {UpdateTeamusersToolArgsType} args - Arguments provided to the tool.
     * @returns {Promise<{ content: Array<{ type: 'text', text: string }> }>} Formatted response for the MCP.
     * @throws {McpError} Formatted error if the controller or service layer encounters an issue.
     */
    async function handleUpdateTeamusers(args: UpdateTeamusersToolArgsType) {
    	const methodLogger = Logger.forContext(
    		"teamusers.tool.ts",
    		"handleUpdateTeamusers",
    	);
    	methodLogger.debug("Updating teamusers...", args);
    
    	try {
    		const result = await teamusersController.updateTeamusers(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 'UpdateTeamusersToolArgs' defining input validation for update: teamId (string), userId (string|number), role (enum: owner, admin, member, biller).
    /**
     * Zod schema for the update team user tool arguments.
     */
    export const UpdateTeamusersToolArgs = z
    	.object({
    		teamId: z.string().describe("Team ID containing the user"),
    		userId: z.union([z.string(), z.number()]).describe("User ID to update"),
    		role: z
    			.enum(["owner", "admin", "member", "biller"])
    			.describe("New role for the user"),
    	})
    	.strict();
    
    export type UpdateTeamusersToolArgsType = z.infer<
    	typeof UpdateTeamusersToolArgs
    >;
  • Controller 'updateTeamusers' that validates inputs (teamId, userId, role), calls teamusersService.update(), and formats response via formatUpdateTeamusersResult().
    async function updateTeamusers(
    	args: UpdateTeamusersToolArgsType,
    ): Promise<ControllerResponse> {
    	const methodLogger = Logger.forContext(
    		"teamusers.controller.ts",
    		"updateTeamusers",
    	);
    	methodLogger.debug("Updating team user...", args);
    
    	try {
    		// Validate inputs
    		if (!args.teamId) {
    			throw new McpError("Team ID is required.", ErrorType.API_ERROR);
    		}
    
    		if (!args.userId) {
    			throw new McpError("User ID is required.", ErrorType.API_ERROR);
    		}
    
    		if (!args.role) {
    			throw new McpError("Role is required.", ErrorType.API_ERROR);
    		}
    
    		// Call service layer
    		const result = await teamusersService.update(args);
    
    		// Format response
    		const formattedContent = formatUpdateTeamusersResult(result);
    
    		methodLogger.debug("Team user updated successfully", {
    			teamId: args.teamId,
    			userId: args.userId,
    			newRole: args.role,
    		});
    
    		return {
    			content: formattedContent,
    		};
    	} catch (error: unknown) {
    		throw handleControllerError(error, {
    			source: "TeamusersController.updateTeamusers",
    			entityType: "TeamUser",
    			entityId: String(args.userId),
    			operation: "updating",
    		});
    	}
    }
  • Service 'update' that calls the Lokalise SDK api.teamUsers().update() with userId, role params, and team_id query param.
    async update(args: UpdateTeamusersToolArgsType): Promise<TeamUser> {
    	const methodLogger = logger.forMethod("update");
    	methodLogger.info("Updating team user", {
    		teamId: args.teamId,
    		userId: args.userId,
    		role: args.role,
    	});
    
    	try {
    		const api = getLokaliseApi();
    		const updateParams: TeamUserParams = {
    			role: args.role,
    		};
    
    		const result = await api
    			.teamUsers()
    			.update(args.userId, updateParams, { team_id: args.teamId });
    
    		methodLogger.info("Updated team user successfully", {
    			teamId: args.teamId,
    			userId: args.userId,
    			newRole: args.role,
    		});
    
    		return result;
    	} catch (error) {
    		methodLogger.error("Failed to update team user", { error, args });
    		throw createUnexpectedError(
    			`Failed to update team user ${args.userId} in team ${args.teamId}`,
    			error,
    		);
    	}
    },
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the update action and return value. It does not mention side effects, authorization requirements, or whether the change is reversible, which is lacking for a mutation tool.

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?

The description is two sentences long, front-loaded with the action and required fields, and every sentence adds value without redundancy.

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?

With no output schema, the description mentions the return value. The tool is simple with 3 required parameters, and the description sufficiently covers purpose, parameters, and outcome. It falls short only in behavioral transparency.

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

Parameters4/5

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

Input schema has 100% coverage for parameters, so baseline is 3. The description adds value by listing required parameters and enumerating the role options, plus describes the return value as 'Updated user profile with new role and permissions,' providing context 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 it updates a team user's role, lists the valid roles (owner, admin, member, biller), and distinguishes from sibling tools like delete_team_user or get_team_user by focusing on role changes.

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?

It explicitly says 'Use to manage permissions, promote/demote, or adjust access levels,' providing clear usage context. However, it does not mention when not to use this tool or suggest alternatives such as using a different endpoint for bulk updates.

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