get_glossary_counts
Retrieve term and language counts for any glossary in your Lara Translate account using its unique glossary ID.
Instructions
Retrieves the term and language counts for a glossary in your Lara Translate account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The glossary ID (format: gls_*, e.g., 'gls_xyz123') |
Implementation Reference
- The main handler function that validates input via getGlossaryCountsSchema and calls lara.glossaries.counts(id) to retrieve glossary counts.
export async function getGlossaryCounts(args: any, lara: Translator) { const validatedArgs = getGlossaryCountsSchema.parse(args); const { id } = validatedArgs; return await lara.glossaries.counts(id); } - Zod schema defining the input for get_glossary_counts: requires a string 'id' with pattern 'gls_*'.
export const getGlossaryCountsSchema = 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:65-65 (registration)Registration of the getGlossaryCounts handler in the handlers map, keyed by tool name.
get_glossary_counts: getGlossaryCounts, - src/mcp/tools.ts:137-138 (registration)Result formatting for get_glossary_counts in the ListTools response.
case "get_glossary_counts": return `Glossary entry count: ${result?.unidirectional ?? result?.multidirectional ?? "retrieved"}`; - src/mcp/tools.ts:440-444 (registration)Tool definition/metadata including name, description, inputSchema, and annotations registered in the MCP ListTools response.
{ name: "get_glossary_counts", description: "Retrieves the term and language counts for a glossary in your Lara Translate account.", inputSchema: z.toJSONSchema(getGlossaryCountsSchema),