delete_terms
Remove specific terms from translation projects in POEditor by specifying exact term and context combinations to delete.
Instructions
Remove one or more terms from the project. Provide the exact term and context combination to delete.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | ||
| items | Yes |
Implementation Reference
- src/server.ts:247-256 (handler)The inline async handler function for the 'delete_terms' tool. It validates the project ID, maps the input items to a payload with term and context, JSON stringifies it, calls the poeditor API endpoint 'terms/delete', and returns the result as formatted JSON text content.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("terms/delete", { id: String(id), data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; }
- src/server.ts:107-113 (schema)Zod schema DeleteTermsInput defining the input structure: optional project_id (positive integer) and required items array (each with required term string and optional context string), with at least one item.const DeleteTermsInput = z.object({ project_id: z.number().int().positive().optional(), items: z.array(z.object({ term: z.string().min(1), context: z.string().optional() })).min(1) });
- src/server.ts:243-257 (registration)The server.tool registration for 'delete_terms', specifying the tool name, description, input schema (DeleteTermsInput.shape), and the inline handler function.server.tool( "delete_terms", "Remove one or more terms from the project. Provide the exact term and context combination to delete.", DeleteTermsInput.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("terms/delete", { id: String(id), data }); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; } );