UNPKG

lokalise-mcp

Version:

The Lokalise MCP Server brings Lokalise's localization power to Claude and AI assistants—manage projects, keys, and translations by chat.

55 lines (54 loc) • 3.07 kB
import type { ControllerResponse } from "../../shared/types/common.types.js"; import type { BulkUpdateTranslationsToolArgsType, GetTranslationToolArgsType, ListTranslationsToolArgsType, UpdateTranslationToolArgsType } from "./translations.types.js"; /** * @namespace TranslationsController * @description Controller responsible for handling Lokalise Translations API operations. * It orchestrates calls to the translations service, applies defaults, * maps options, and formats the response using the formatter. */ /** * @function listTranslations * @description Fetches a list of translations from a Lokalise project using cursor pagination. * @memberof TranslationsController * @param {ListTranslationsToolArgsType} args - Arguments containing project ID, cursor, and filters * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the formatted translations list in Markdown. * @throws {McpError} Throws an McpError (handled by `handleControllerError`) if the service call fails or returns an error. */ declare function listTranslations(args: ListTranslationsToolArgsType): Promise<ControllerResponse>; /** * @function getTranslation * @description Fetches details of a specific translation. * @memberof TranslationsController * @param {GetTranslationToolArgsType} args - Arguments containing project ID and translation ID * @returns {Promise<ControllerResponse>} A promise that resolves to the formatted translation details. * @throws {McpError} Throws an McpError if the service call fails. */ declare function getTranslation(args: GetTranslationToolArgsType): Promise<ControllerResponse>; /** * @function updateTranslation * @description Updates a translation in a project. * @memberof TranslationsController * @param {UpdateTranslationToolArgsType} args - Arguments containing project ID, translation ID and update data * @returns {Promise<ControllerResponse>} A promise that resolves to the formatted update result. * @throws {McpError} Throws an McpError if the service call fails. */ declare function updateTranslation(args: UpdateTranslationToolArgsType): Promise<ControllerResponse>; /** * @function bulkUpdateTranslations * @description Updates multiple translations in bulk with rate limiting. * @memberof TranslationsController * @param {BulkUpdateTranslationsToolArgsType} args - Arguments containing project ID and array of updates * @returns {Promise<ControllerResponse>} A promise that resolves to the formatted bulk update result. * @throws {McpError} Throws an McpError if the service call fails. */ declare function bulkUpdateTranslations(args: BulkUpdateTranslationsToolArgsType): Promise<ControllerResponse>; /** * Export the controller functions */ declare const translationsController: { listTranslations: typeof listTranslations; getTranslation: typeof getTranslation; updateTranslation: typeof updateTranslation; bulkUpdateTranslations: typeof bulkUpdateTranslations; }; export default translationsController;