update_memory
Modify translation memory entries in Lara Translate to maintain accurate and consistent translations across projects.
Instructions
Updates a translation memory in your Lara Translate account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The unique identifier of the memory to update. Format: mem_xyz123 | |
| name | Yes |
Implementation Reference
- The handler function that executes the update_memory tool: parses args with schema, extracts id and name, then calls lara.memories.update(id, name).export async function updateMemory(args: any, lara: Translator) { const validatedArgs = updateMemorySchema.parse(args); const { id, name } = validatedArgs; return await lara.memories.update(id, name); }
- Zod input schema for update_memory tool defining 'id' (string, format mem_xyz123) and 'name' (string max 250 chars).export const updateMemorySchema = z.object({ id: z .string() .describe( "The unique identifier of the memory to update. Format: mem_xyz123" ), name: z .string() .describe("The new name for the memory") .refine((name) => name.length <= 250, { message: "Name can't be more than 250 characters", }), });
- src/mcp/tools.ts:36-45 (registration)Registration of tool handlers in the handlers map, including update_memory: updateMemory.const handlers: Record<string, Handler> = { translate: translateHandler, create_memory: createMemory, delete_memory: deleteMemory, update_memory: updateMemory, add_translation: addTranslation, delete_translation: deleteTranslation, import_tmx: importTmx, check_import_status: checkImportStatus, };
- src/mcp/tools.ts:108-113 (registration)Registration of the update_memory tool in the ListTools response, including name, description, and inputSchema.{ name: "update_memory", description: "Updates a translation memory in your Lara Translate account.", inputSchema: z.toJSONSchema(updateMemorySchema), },
- src/mcp/tools.ts:27-29 (registration)Import of updateMemory handler and updateMemorySchema from the tool module.updateMemory, updateMemorySchema, } from "./tools/update_memory.tool.js";