export_glossary
Export a glossary from your Lara Translate account as CSV. Supports unidirectional with source language or multidirectional format.
Instructions
Exports a glossary as CSV from your Lara Translate account. Supports unidirectional and multidirectional formats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The glossary ID (format: gls_*, e.g., 'gls_xyz123') | |
| content_type | Yes | The export format. 'csv/table-uni' for unidirectional (requires source parameter), 'csv/table-multi' for multidirectional | |
| source | No | The source language code. Required when content_type is 'csv/table-uni' |
Implementation Reference
- src/mcp/tools/export_glossary.ts:19-24 (handler)The main handler function that executes the export_glossary tool logic. It validates arguments via the schema, then calls lara.glossaries.export().
export async function exportGlossary(args: any, lara: Translator) { const validatedArgs = exportGlossarySchema.parse(args); const { id, content_type, source } = validatedArgs; return await lara.glossaries.export(id, content_type, source); } - Zod schema defining the input validation for export_glossary: requires id (gls_* format), content_type (csv/table-uni or csv/table-multi), and optional source (required for unidirectional export).
export const exportGlossarySchema = 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')"), content_type: z .enum(["csv/table-uni", "csv/table-multi"]) .describe("The export format. 'csv/table-uni' for unidirectional (requires source parameter), 'csv/table-multi' for multidirectional"), source: z .string() .optional() .describe("The source language code. Required when content_type is 'csv/table-uni'"), }); - src/mcp/tools.ts:64-64 (registration)Registers exportGlossary handler in the handlers record so it can be dispatched by name 'export_glossary'.
export_glossary: exportGlossary, - src/mcp/tools.ts:427-439 (registration)Tool definition registered in the MCP toolDefinitions array with name 'export_glossary', description, inputSchema, annotations (readOnlyHint: true), and invocation meta.
{ name: "export_glossary", description: "Exports a glossary as CSV from your Lara Translate account. Supports unidirectional and multidirectional formats.", inputSchema: z.toJSONSchema(exportGlossarySchema), annotations: { title: "Export glossary as CSV", readOnlyHint: true, destructiveHint: false, openWorldHint: false, }, _meta: invocationMeta("Exporting glossary…", "Glossary exported"), }, - src/mcp/tools.ts:135-136 (helper)Narration helper that produces the user-facing message 'Exported glossary as CSV' when this tool completes.
case "export_glossary": return "Exported glossary as CSV";