Skip to main content
Glama

list_terms

Retrieve project terms and their translations from POEditor to manage multilingual content and track translation progress for specific languages.

Instructions

List project terms (optionally include translations for a language).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNo
pageNo
per_pageNo
project_idNo

Implementation Reference

  • Handler function for the 'list_terms' tool. Fetches terms from POEditor API, processes them by extracting relevant fields, applies optional search filter, field selection, limit, and count_only options, then returns the result as JSON.
    async (args) => { const id = requireProjectId(args.project_id ?? null); const form: Record<string, string> = { id: String(id) }; if (args.language) form.language = args.language; const res = await poeditor("terms/list", form); // Extract term and translation content to reduce response size let terms = res.result?.terms?.map((t: any) => ({ term: t.term, context: t.context || undefined, translation: t.translation?.content || undefined })) ?? []; // Apply search filter (case-insensitive substring match on term, context, translation) if (args.search) { const searchLower = args.search.toLowerCase(); terms = terms.filter((t: any) => t.term?.toLowerCase().includes(searchLower) || t.context?.toLowerCase().includes(searchLower) || t.translation?.toLowerCase().includes(searchLower) ); } // Apply fields selection if (args.fields && args.fields.length > 0) { const fieldSet = new Set(args.fields); terms = terms.map((t: any) => { const filtered: any = {}; if (fieldSet.has("term")) filtered.term = t.term; if (fieldSet.has("context")) filtered.context = t.context; if (fieldSet.has("translation")) filtered.translation = t.translation; return filtered; }); } const total = terms.length; // Return count only if requested if (args.count_only) { return { content: [{ type: "text", text: JSON.stringify({ total }) }] }; } // Apply limit if (args.limit && args.limit < terms.length) { terms = terms.slice(0, args.limit); } const result = { terms, total }; return { content: [{ type: "text", text: JSON.stringify(result) }] }; }
  • Zod schema defining the input parameters for the 'list_terms' tool.
    const ListTermsInput = z.object({ project_id: z.number().int().positive().optional(), language: z.string().optional(), limit: z.number().int().positive().optional(), search: z.string().optional(), count_only: z.boolean().optional(), fields: z.array(z.enum(["term", "context", "translation"])).optional() });
  • src/server.ts:186-241 (registration)
    Registration of the 'list_terms' tool using server.tool(), providing name, description, input schema, and inline handler.
    server.tool( "list_terms", "List all project terms (optionally include translations for a specific language). Returns only term names, contexts, and translation content to minimize response size. Use limit, search, count_only, and fields parameters to reduce token usage.", ListTermsInput.shape, async (args) => { const id = requireProjectId(args.project_id ?? null); const form: Record<string, string> = { id: String(id) }; if (args.language) form.language = args.language; const res = await poeditor("terms/list", form); // Extract term and translation content to reduce response size let terms = res.result?.terms?.map((t: any) => ({ term: t.term, context: t.context || undefined, translation: t.translation?.content || undefined })) ?? []; // Apply search filter (case-insensitive substring match on term, context, translation) if (args.search) { const searchLower = args.search.toLowerCase(); terms = terms.filter((t: any) => t.term?.toLowerCase().includes(searchLower) || t.context?.toLowerCase().includes(searchLower) || t.translation?.toLowerCase().includes(searchLower) ); } // Apply fields selection if (args.fields && args.fields.length > 0) { const fieldSet = new Set(args.fields); terms = terms.map((t: any) => { const filtered: any = {}; if (fieldSet.has("term")) filtered.term = t.term; if (fieldSet.has("context")) filtered.context = t.context; if (fieldSet.has("translation")) filtered.translation = t.translation; return filtered; }); } const total = terms.length; // Return count only if requested if (args.count_only) { return { content: [{ type: "text", text: JSON.stringify({ total }) }] }; } // Apply limit if (args.limit && args.limit < terms.length) { terms = terms.slice(0, args.limit); } const result = { terms, total }; return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryan-shaw/poeditor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server