Skip to main content
Glama
lingvanex-mt

Lingvanex Translate MCP Server

Official
by lingvanex-mt

translate_text

Translate text between languages using source and target language codes to convert content for multilingual communication and understanding.

Instructions

Translate text from one language to another

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceLangYesSource language code
targetLangYesTarget language code
textYesText to translate

Implementation Reference

  • The asynchronous handler function that executes the core logic of the 'translate_text' tool by invoking the translateText utility and formatting the MCP response.
    async({ text, sourceLang, targetLang }) => {
      const translated = await translateText(text, sourceLang, targetLang)
      return { content: [{ type: 'text', text: translated }] }
    },
  • Zod schema defining the input parameters for the 'translate_text' tool: text, sourceLang, and targetLang.
    {
      text: z.string().describe('Text to translate'),
      sourceLang: z.string().length(2).describe('Source language code'),
      targetLang: z.string().length(2).describe('Target language code'),
    },
  • src/index.ts:22-22 (registration)
    Registers the 'translate_text' tool on the MCP server by calling the toolTranslateText function.
    toolTranslateText(server)
  • Supporting utility function that performs the actual translation via API call, used by the tool handler.
    export async function translateText(
      text: string,
      source: string,
      target: string,
    ): Promise<string> {
      const response = await fetch(`${TRANSLATE_API_URL}/translate`, {
        method: 'POST',
        headers: {
          accept: 'application/json',
          'Content-Type': 'application/json',
          Authorization: TRANSLATE_API_KEY,
        },
        body: JSON.stringify(
          {
            platform: 'api', data: text, from: source, to: target,
          },
        ),
      })
    
      if (!response.ok) {
        throw new Error(`Translation API error: ${response.status} ${response.statusText}`)
      }
    
      const data = await response.json() as {
        error: boolean,
        result: string
      }
    
      return data.result
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'translate' implies a read-only operation, it doesn't specify whether this requires authentication, has rate limits, what happens with invalid language codes, or any error handling. The description provides minimal behavioral context beyond the basic function.

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

Conciseness5/5

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

The description is extremely concise - a single sentence that directly states the tool's function with zero wasted words. It's front-loaded with the essential information and doesn't contain any unnecessary elaboration.

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

Completeness2/5

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

For a translation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the output looks like (translated text format), doesn't mention language code standards (ISO 639-1 implied but not stated), and provides no behavioral context about limitations or requirements.

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?

With 100% schema description coverage, all parameters are documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions (e.g., format details, language code standards, text length limits). This meets the baseline for high schema coverage.

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: 'Translate text from one language to another' - a specific verb ('translate') with the resource ('text') and scope ('from one language to another'). However, with no sibling tools mentioned, there's no opportunity to distinguish from alternatives, preventing 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 Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints. It simply states what the tool does without any contextual usage information, leaving the agent to infer appropriate scenarios.

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/lingvanex-mt/MCP-Lingvanex-Translate'

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