Skip to main content
Glama

lokalise_get_task

Retrieve detailed information about a specific translation task, including progress, assignments, and history, to check status or debug workflow issues.

Instructions

Investigates a specific work assignment in detail. Required: projectId, taskId. Use to check task progress, view assignee workload, or debug workflow issues. Returns: Complete task data including all assignments, completion percentages, settings, and history. Pairs with: lokalise_update_task for modifications.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID containing the task
taskIdYesTask ID to get details for

Implementation Reference

  • MCP tool handler for 'lokalise_get_task'. Receives projectId and taskId arguments, calls tasksController.getTask, and formats the response for MCP.
    async function handleGetTask(args: GetTaskToolArgsType) {
    	const methodLogger = Logger.forContext(
    		"tools/tasks.tool.ts",
    		"handleGetTask",
    	);
    	methodLogger.debug(
    		`Getting task ${args.taskId} from project ${args.projectId}...`,
    		args,
    	);
    
    	try {
    		const result = await tasksController.getTask(args);
    		methodLogger.debug("Got the response from the controller", result);
    
    		return {
    			content: [
    				{
    					type: "text" as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error("Error in handleGetTask", { error, args });
    		return formatErrorForMcpTool(error);
    	}
    }
  • Zod schema defining input arguments for getTask: projectId (string) and taskId (number). Exports the inferred TypeScript type GetTaskToolArgsType.
    export const GetTaskToolArgs = z
    	.object({
    		projectId: z.string().describe("Project ID containing the task"),
    		taskId: z.number().describe("Task ID to get details for"),
    	})
    	.strict();
    
    export type GetTaskToolArgsType = z.infer<typeof GetTaskToolArgs>;
  • Registration of the 'lokalise_get_task' tool on the MCP server with name, description, schema shape, and handler function.
    // Get Task Tool
    server.tool(
    	"lokalise_get_task",
    	"Investigates a specific work assignment in detail. Required: projectId, taskId. Use to check task progress, view assignee workload, or debug workflow issues. Returns: Complete task data including all assignments, completion percentages, settings, and history. Pairs with: lokalise_update_task for modifications.",
    	GetTaskToolArgs.shape,
    	handleGetTask,
    );
  • Controller logic for getTask. Maps tool args to service parameters (GetTaskParams), calls tasksService.getTask, and formats the result using formatTaskDetails.
    async function getTask(args: GetTaskToolArgsType): Promise<ControllerResponse> {
    	const methodLogger = Logger.forContext(
    		"controllers/tasks.controller.ts",
    		"getTask",
    	);
    
    	try {
    		methodLogger.debug("Starting getTask operation", {
    			projectId: args.projectId,
    			taskId: args.taskId,
    		});
    
    		// Map arguments to service parameters
    		const serviceParams: tasksService.GetTaskParams = {
    			project_id: args.projectId,
    			task_id: args.taskId,
    		};
    
    		const result = await tasksService.getTask(serviceParams);
    
    		methodLogger.debug("Task retrieval successful", {
    			projectId: args.projectId,
    			taskId: args.taskId,
    			title: result.title,
    		});
    
    		const formatted = formatTaskDetails(result, args.projectId);
    
    		return { content: formatted };
    	} catch (error) {
    		throw handleControllerError(
    			error,
    			buildErrorContext(
    				"Lokalise Task",
    				"getTask",
    				"controllers/tasks.controller.ts@getTask",
    				`${args.projectId}:${args.taskId}`,
    				{ args },
    			),
    		);
    	}
    }
  • Service layer that calls the Lokalise Tasks API via the SDK (api.tasks().get()) to fetch a single task by project_id and task_id. Includes error handling for 404, 403, 401.
    					throw createApiError(
    						"Tasks with languages require either 'users' or 'groups' to be specified for each language, or use the 'assignees' parameter to assign users to all languages",
    						400,
    					);
    				}
    				return lang;
    			});
    		}
    
    		const result = await api
    			.tasks()
    			.create(apiParams, { project_id: options.project_id });
    
    		methodLogger.debug("Lokalise Tasks API call successful - create", {
    			projectId: options.project_id,
    			taskId: result.task_id,
    			title: result.title,
    		});
    
    		return result;
    	} catch (error: unknown) {
    		methodLogger.error("Lokalise Tasks API call failed - create", {
    			error: (error as Error).message,
    			projectId: options.project_id,
    		});
    
    		if ((error as ApiError).code === 404) {
    			throw createApiError(`Project not found: ${options.project_id}`, 404);
    		}
    		if ((error as ApiError).code === 403) {
    			throw createApiError("Access denied to this project", 403);
    		}
    		if ((error as ApiError).code === 401) {
    			throw createApiError("Invalid API key", 401);
    		}
    
    		throw createUnexpectedError(
    			`Failed to create task in project ${options.project_id}: ${(error as Error).message}`,
    		);
    	}
    }
    
    /**
Behavior3/5

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

No annotations provided, so description carries full burden. It mentions return data ('complete task data including all assignments, completion percentages, settings, and history') but does not explicitly state that it is read-only or disclose any side effects. Adequate but not thorough.

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?

Highly concise: first sentence states purpose, then required params, then use cases, then return format, finally pairing with sibling. Every sentence is justified and front-loaded.

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?

Given no output schema, description adequately explains return data and use cases. It covers the main actions an agent would need for a detail retrieval tool, making it fully complete.

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%, and the description only reiterates 'Required: projectId, taskId', adding no new meaning beyond the schema. Baseline of 3 is appropriate.

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 uses a specific verb 'Investigates' and resource 'specific work assignment' clearly distinguishing it from listing tasks (lokalise_list_tasks). It explicitly mentions retrieving task details.

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 states when to use: 'check task progress, view assignee workload, or debug workflow issues'. Also pairs with lokalise_update_task for modifications, implying not for modifications. Could mention if it's for read-only but still clear.

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