delete_translations
Remove obsolete translations for specific terms in a language from POEditor translation projects to maintain accurate multilingual content.
Instructions
Delete translations for specific terms in a language. Only remove translations you are certain are obsolete.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | ||
| language | Yes | ||
| items | Yes |
Implementation Reference
- src/server.ts:362-375 (handler)Inline asynchronous handler function that executes the delete_translations tool logic by preparing payload from input items and calling the poeditor API endpoint for deleting translations.async (args) => { const id = requireProjectId(args.project_id ?? null); const payload = args.items.map((item) => ({ term: item.term, context: item.context ?? "" })); const data = JSON.stringify(payload); const res = await poeditor("translations/delete", { id: String(id), language: args.language, data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; }
- src/server.ts:129-136 (schema)Zod input schema definition for the delete_translations tool, validating project_id (optional), language, and array of items with term and optional context.const DeleteTranslationsInput = 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() })).min(1) });
- src/server.ts:358-376 (registration)Registration of the delete_translations tool on the McpServer instance, specifying name, description, input schema, and inline handler function.server.tool( "delete_translations", "Delete translations for specific terms in a language. Only remove translations you are certain are obsolete.", DeleteTranslationsInput.shape, async (args) => { const id = requireProjectId(args.project_id ?? null); const payload = args.items.map((item) => ({ term: item.term, context: item.context ?? "" })); const data = JSON.stringify(payload); const res = await poeditor("translations/delete", { id: String(id), language: args.language, data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; } );