create_memory
Create a translation memory to store source-target text pairs for reuse in future translations within the Lara Translate MCP Server.
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
TableJSON 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 main handler function for the create_memory tool. Validates input using createMemorySchema and delegates to lara.memories.create.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 defining the input structure for the create_memory tool: name (required, string <=250 chars) and optional external_id.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:36-45 (registration)Dispatch map registering the create_memory tool name to its handler function createMemory.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:96-101 (registration)MCP tool specification registration in ListTools, defining name, description, and inputSchema for create_memory.{ 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), },