Skip to main content
Glama

update_translations

Update or overwrite translations for a specific language in POEditor projects. Provide term translations with optional context, plural forms, and fuzzy matching to maintain translation accuracy.

Instructions

Update/overwrite translations for a language. Important: if a term was created with a context, you must provide the same context value to match that term.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
languageYes
project_idNo

Implementation Reference

  • Handler function that updates translations for existing terms in a language by calling the POEditor 'translations/update' API endpoint. Prepares a payload from input items and returns the API response.
    async (args) => { const id = requireProjectId(args.project_id ?? null); const payload = args.items.map((i) => ({ term: i.term, context: i.context ?? "", translation: i.plural ? { plural: i.plural } : { content: i.content, fuzzy: i.fuzzy ? 1 : 0 } })); const data = JSON.stringify(payload); const res = await poeditor("translations/update", { id: String(id), language: args.language, data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] };
  • Zod schema defining the input for update_translations tool: optional project_id, required language, and array of translation items with term, optional context, content, fuzzy, and plural forms.
    const TranslationsInput = z.object({ project_id: z.number().int().positive().optional(), language: z.string().min(2), items: z.array(z.object({ term: z.string().min(1), context: z.string().optional(), content: z.string().default(""), fuzzy: z.boolean().optional(), plural: z.object({ one: z.string().optional(), few: z.string().optional(), many: z.string().optional(), other: z.string().optional() }).partial().optional() })).min(1) });
  • src/server.ts:169-184 (registration)
    Registers the 'update_translations' tool on the MCP server with name, description, input schema, and handler function.
    server.tool( "update_translations", "Update/overwrite translations for a language. Important: if a term was created with a context, you must provide the same context value to match that term.", TranslationsInput.shape, async (args) => { const id = requireProjectId(args.project_id ?? null); const payload = args.items.map((i) => ({ term: i.term, context: i.context ?? "", translation: i.plural ? { plural: i.plural } : { content: i.content, fuzzy: i.fuzzy ? 1 : 0 } })); const data = JSON.stringify(payload); const res = await poeditor("translations/update", { id: String(id), language: args.language, data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; } );

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/ryan-shaw/poeditor-mcp'

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