Skip to main content
Glama

list_terms

Retrieve translation terms from POEditor projects with optional filtering by language, search, and specific fields to optimize data retrieval.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNo
languageNo
limitNo
searchNo
count_onlyNo
fieldsNo

Implementation Reference

  • The handler function for the 'list_terms' tool. It fetches terms from POEditor API, applies optional filters (search, fields), limits, and count-only mode, then returns a JSON-formatted response.
    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 input schema for the 'list_terms' tool defining optional parameters: project_id, language, limit, search, count_only, and fields.
    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 function.
    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) }] };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'Returns only term names, contexts, and translation content to minimize response size,' which adds useful context about output behavior. However, it lacks details on permissions, rate limits, pagination, or error handling, which are important for a list operation with multiple parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose and following with parameter usage tips. Both sentences earn their place by adding value, though it could be slightly more structured (e.g., separating purpose from parameter guidance more clearly).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no annotations, no output schema), the description is partially complete. It covers the tool's purpose and hints at parameter usage but lacks details on output format, error cases, or integration with sibling tools. Without an output schema, more explanation of return values would be beneficial, though the mention of minimized response size helps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds some meaning beyond the input schema by explaining the purpose of parameters like 'limit, search, count_only, and fields' to reduce token usage. However, with 0% schema description coverage and 6 parameters, it doesn't fully compensate for the lack of schema documentation—key parameters like 'project_id' and 'language' are mentioned but not elaborated on, leaving gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all project terms (optionally include translations for a specific language).' It specifies the verb ('List'), resource ('project terms'), and optional scope ('translations for a specific language'). However, it doesn't explicitly differentiate from sibling tools like 'list_available_languages' or 'list_languages', which reduces it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning parameters like 'limit' and 'search' to reduce token usage, but it doesn't provide explicit guidance on when to use this tool versus alternatives (e.g., 'list_available_languages' for languages instead of terms). No exclusions or prerequisites are stated, leaving usage somewhat open to interpretation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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