update_memory
Update a translation memory's name in your Lara Translate account. Requires memory ID and new name.
Instructions
Updates a translation memory in your Lara Translate account.
Input 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 logic. It validates args with Zod 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 schema defining the input for update_memory: requires 'id' (string, memory identifier) and 'name' (string, max 250 characters).
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:48-68 (registration)The handlers record where 'update_memory' is mapped to the updateMemory function (line 53).
const handlers: Record<string, Handler> = { detect_language: detectLanguage, translate: translateHandler, create_memory: createMemory, delete_memory: deleteMemory, update_memory: updateMemory, add_translation: addTranslation, delete_translation: deleteTranslation, import_tmx: importTmx, check_import_status: checkImportStatus, get_glossary: getGlossary, create_glossary: createGlossary, update_glossary: updateGlossary, delete_glossary: deleteGlossary, import_glossary_csv: importGlossaryCsv, check_glossary_import_status: checkGlossaryImportStatus, export_glossary: exportGlossary, get_glossary_counts: getGlossaryCounts, add_glossary_entry: addGlossaryEntry, delete_glossary_entry: deleteGlossaryEntry, }; - src/mcp/tools.ts:255-266 (registration)The tool definition in the toolDefinitions array, registering update_memory with its description, title 'Rename translation memory', and non-destructive hint.
{ name: "update_memory", description: "Updates a translation memory in your Lara Translate account.", inputSchema: z.toJSONSchema(updateMemorySchema), annotations: { title: "Rename translation memory", readOnlyHint: false, destructiveHint: false, openWorldHint: false, }, }, - src/mcp/tools.ts:105-106 (registration)The narrate() switch case that generates a human-readable response: 'Renamed translation memory to ...'.
case "update_memory": return `Renamed translation memory to "${result?.name ?? args?.name ?? ""}"`;