lokalise_list_glossary_terms
Retrieve paginated glossary terms for a project to discover defined terminology, including brand names and forbidden words, ensuring translation consistency and preventing errors.
Instructions
Retrieves paginated glossary terms that define translation rules for consistency. Required: projectId. Optional: limit (100), cursor for pagination. Use to discover defined terminology including brand names, technical terms, and forbidden words. Returns: Terms with properties (case-sensitive, translatable, forbidden) and translations. Essential before translating to prevent terminology errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID to list glossary terms for | |
| limit | No | Number of glossary terms to return (1-5000, default: 100) | |
| cursor | No | Cursor for pagination. Use nextCursor from previous response |
Implementation Reference
- The MCP tool handler function for 'lokalise_list_glossary_terms'. Calls glossaryController.listGlossaryTerms() and formats the response.
async function handleListGlossaryTerms(args: ListGlossaryToolArgsType) { const methodLogger = Logger.forContext( "glossary.tool.ts", "handleListGlossaryTerms", ); methodLogger.debug( `Getting Lokalise glossary terms list (limit: ${args.limit || "default"}, cursor: ${args.cursor || "none"})...`, args, ); try { const result = await glossaryController.listGlossaryTerms(args); methodLogger.debug("Got the response from the controller", result); return { content: [ { type: "text" as const, text: result.content, }, ], }; } catch (error) { methodLogger.error("Tool failed", { error: (error as Error).message, args, }); return formatErrorForMcpTool(error); } } - Zod schema defining input args for list glossary terms tool: projectId (string), limit (optional number 1-5000), cursor (optional string for pagination).
export const ListGlossaryToolArgs = z .object({ projectId: z.string().describe("Project ID to list glossary terms for"), limit: z .number() .int() .min(1) .max(5000) .optional() .describe("Number of glossary terms to return (1-5000, default: 100)"), cursor: z .string() .optional() .describe("Cursor for pagination. Use nextCursor from previous response"), }) .strict(); export type ListGlossaryToolArgsType = z.infer<typeof ListGlossaryToolArgs>; - src/domains/glossary/glossary.tool.ts:227-232 (registration)Registration of the tool named 'lokalise_list_glossary_terms' on the MCP server with description, schema (ListGlossaryToolArgs.shape), and handler (handleListGlossaryTerms).
server.tool( "lokalise_list_glossary_terms", "Retrieves paginated glossary terms that define translation rules for consistency. Required: projectId. Optional: limit (100), cursor for pagination. Use to discover defined terminology including brand names, technical terms, and forbidden words. Returns: Terms with properties (case-sensitive, translatable, forbidden) and translations. Essential before translating to prevent terminology errors.", ListGlossaryToolArgs.shape, handleListGlossaryTerms, );