create_glossary
Create a glossary with a custom name to enforce specific terminology during translations in your Lara Translate account.
Instructions
Create a glossary with a custom name in your Lara Translate account. Glossaries enforce specific terminology during translation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/mcp/tools/create_glossary.ts:15-19 (handler)The main handler function that executes the create_glossary tool logic. It validates the input args using the schema, extracts the name, and calls lara.glossaries.create(name).
export async function createGlossary(args: any, lara: Translator) { const validatedArgs = createGlossarySchema.parse(args); const { name } = validatedArgs; return await lara.glossaries.create(name); } - Input schema for create_glossary using Zod. Defines a 'name' field with a maximum length of 250 characters and a descriptive prompt.
export const createGlossarySchema = z.object({ name: z .string() .describe( "The name of the new glossary, it should be short and descriptive, like 'brand_terms' or 'legal_terminology'" ) .refine((name) => name.length <= 250, { message: "Name of the glossary can't be more than 250 characters", }), }); - src/mcp/tools.ts:59-59 (registration)Registration of the createGlossary function in the handlers record, mapping the tool name 'create_glossary' to its handler.
create_glossary: createGlossary, - src/mcp/tools.ts:365-369 (registration)Tool definition/registration with name, description, inputSchema, and annotations for the MCP protocol.
{ name: "create_glossary", description: "Create a glossary with a custom name in your Lara Translate account. Glossaries enforce specific terminology during translation.", inputSchema: z.toJSONSchema(createGlossarySchema), - src/mcp/tools.ts:121-122 (helper)Response formatting helper for the create_glossary tool, producing a human-readable success message.
case "create_glossary": return `Created glossary "${result?.name ?? args?.name ?? ""}"`;