create_memory
Create a named translation memory to store reusable source-target text pairs for consistent future translations.
Instructions
Create a translation memory with a custom name in your Lara Translate account. Translation memories store pairs of source and target text segments (translation units) for reuse in future translations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| external_id | No | The ID of the memory to be imported from MyMemory. Use this to initialize the memory with external content. Format: ext_my_[MyMemory ID] |
Implementation Reference
- src/mcp/tools/create_memory.ts:21-25 (handler)The actual handler function that executes the create_memory tool. It validates args using createMemorySchema, then calls lara.memories.create(name, external_id).
export async function createMemory(args: any, lara: Translator) { const validatedArgs = createMemorySchema.parse(args); const { name, external_id } = validatedArgs; return await lara.memories.create(name, external_id); } - src/mcp/tools/create_memory.ts:4-19 (schema)Zod schema for create_memory input validation. Defines 'name' (required, string, max 250 chars) and 'external_id' (optional string for importing from MyMemory).
export const createMemorySchema = z.object({ name: z .string() .describe( "The name of the new memory, it should be short and generic, like 'catch_phrases' or 'brand_names'" ) .refine((name) => name.length <= 250, { message: "Name of the memory can't be more than 250 characters", }), external_id: z .string() .describe( "The ID of the memory to be imported from MyMemory. Use this to initialize the memory with external content. Format: ext_my_[MyMemory ID]" ) .optional(), }); - src/mcp/tools.ts:51-51 (registration)Registration of create_memory in the handlers map, mapping the tool name to the createMemory handler function.
create_memory: createMemory, - src/mcp/tools.ts:231-242 (registration)Tool definition registration including name, description, inputSchema, and annotations (title, readOnlyHint, destructiveHint, openWorldHint).
{ name: "create_memory", description: "Create a translation memory with a custom name in your Lara Translate account. Translation memories store pairs of source and target text segments (translation units) for reuse in future translations.", inputSchema: z.toJSONSchema(createMemorySchema), annotations: { title: "Create translation memory", readOnlyHint: false, destructiveHint: false, openWorldHint: false, }, }, - src/mcp/tools.ts:103-104 (registration)Narration/response formatting for create_memory tool results (e.g., 'Created translation memory "..."').
case "create_memory": return `Created translation memory "${result?.name ?? args?.name ?? ""}"`;