update_glossary
Update the name of an existing glossary in your Lara Translate account using its glossary ID and a new name.
Instructions
Updates the name of a glossary in your Lara Translate account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The glossary ID (format: gls_*, e.g., 'gls_xyz123') | |
| name | Yes |
Implementation Reference
- src/mcp/tools/update_glossary.ts:18-22 (handler)The handler function that executes the update_glossary tool logic. Validates input using the schema, then calls lara.glossaries.update(id, name) to rename the glossary.
export async function updateGlossary(args: any, lara: Translator) { const validatedArgs = updateGlossarySchema.parse(args); const { id, name } = validatedArgs; return await lara.glossaries.update(id, name); } - Zod schema for update_glossary input validation. Requires 'id' (gls_* format, 1-255 chars) and 'name' (string, max 250 chars).
export const updateGlossarySchema = z.object({ id: z.string() .min(1) .max(255) .regex(/^gls_[a-zA-Z0-9_-]+$/, "Invalid glossary ID format") .describe("The glossary ID (format: gls_*, e.g., 'gls_xyz123')"), name: z .string() .describe("The new name for the glossary") .refine((name) => name.length <= 250, { message: "Name can't be more than 250 characters", }), }); - src/mcp/tools.ts:60-60 (registration)Registration of update_glossary in the handlers record, mapping the tool name string to the handler function.
update_glossary: updateGlossary, - src/mcp/tools.ts:377-388 (registration)Tool definition registration for update_glossary in the toolDefinitions array (exposed via ListTools). Includes description, input schema, and annotations.
{ name: "update_glossary", description: "Updates the name of a glossary in your Lara Translate account.", inputSchema: z.toJSONSchema(updateGlossarySchema), annotations: { title: "Rename glossary", readOnlyHint: false, destructiveHint: false, openWorldHint: false, }, }, - src/mcp/tools.ts:123-124 (registration)Narration helper in the narrate() function that generates a user-facing message for update_glossary results.
case "update_glossary": return `Renamed glossary to "${result?.name ?? args?.name ?? ""}"`;