get_glossary
Retrieve a specific glossary from your Lara Translate account using its unique ID. Returns null if the glossary does not exist.
Instructions
Retrieves a specific glossary by ID from your Lara Translate account. Returns null if the glossary is not found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The glossary ID (format: gls_*, e.g., 'gls_xyz123') |
Implementation Reference
- src/mcp/tools/get_glossary.ts:12-17 (handler)The getGlossary function executes the tool logic. It validates args using the schema, extracts the glossary 'id', and calls lara.glossaries.get(id) to retrieve the glossary.
export async function getGlossary(args: unknown, lara: Translator) { const validatedArgs = getGlossarySchema.parse(args); const { id } = validatedArgs; return await lara.glossaries.get(id); } - src/mcp/tools/get_glossary.ts:4-10 (schema)The getGlossarySchema defines input validation: a required 'id' string (1-255 chars) matching the format gls_* (e.g., 'gls_xyz123').
export const getGlossarySchema = 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')"), }); - src/mcp/tools.ts:58-68 (registration)The handler is registered in the handlers map under the key 'get_glossary', mapping to the imported getGlossary function.
get_glossary: getGlossary, create_glossary: createGlossary, update_glossary: updateGlossary, delete_glossary: deleteGlossary, import_glossary_csv: importGlossaryCsv, check_glossary_import_status: checkGlossaryImportStatus, export_glossary: exportGlossary, get_glossary_counts: getGlossaryCounts, add_glossary_entry: addGlossaryEntry, delete_glossary_entry: deleteGlossaryEntry, }; - src/mcp/tools.ts:353-364 (registration)The tool definition in toolDefinitions array registers 'get_glossary' with its description, inputSchema, and annotations (readOnlyHint: true).
{ name: "get_glossary", description: "Retrieves a specific glossary by ID from your Lara Translate account. Returns null if the glossary is not found.", inputSchema: z.toJSONSchema(getGlossarySchema), annotations: { title: "Get glossary", readOnlyHint: true, destructiveHint: false, openWorldHint: false, }, }, - src/mcp/tools.ts:119-142 (registration)The narrate function handles the 'get_glossary' case, producing a user-readable summary like 'Retrieved glossary "..."'.
case "get_glossary": return `Retrieved glossary "${result?.name ?? args?.id ?? ""}"`; case "create_glossary": return `Created glossary "${result?.name ?? args?.name ?? ""}"`; case "update_glossary": return `Renamed glossary to "${result?.name ?? args?.name ?? ""}"`; case "delete_glossary": return `Deleted glossary ${result?.id ?? args?.id ?? ""}`; case "add_glossary_entry": return "Added entry to glossary"; case "delete_glossary_entry": return "Deleted entry from glossary"; case "import_glossary_csv": return `Queued glossary CSV import${result?.id ? " (job " + result.id + ")" : ""}`; case "check_glossary_import_status": return `Glossary import status: ${result?.status ?? "unknown"}`; case "export_glossary": return "Exported glossary as CSV"; case "get_glossary_counts": return `Glossary entry count: ${result?.unidirectional ?? result?.multidirectional ?? "retrieved"}`; default: return `${name} completed`; } }