Skip to main content
Glama

HuggingFace — Machine Translation

hf_inference.nlp.translate
Read-onlyIdempotent

Translate text between languages using the Helsinki-NLP opus-mt model family via HuggingFace Inference API. Covers 1,000+ language pairs (English to French, Spanish, German, Chinese, Japanese, Arabic, Russian, etc.). Specify target_lang as a 2-letter ISO 639-1 code (e.g. "fr", "es", "de", "zh", "ja"). The adapter automatically selects the opus-mt-{source}-{target} model. Useful for multilingual content pipelines, localization, and cross-language information retrieval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesInput text to process. Maximum ~10,000 characters depending on model context window.
modelNoOverride the HuggingFace model ID for translation. If omitted, the adapter automatically selects "Helsinki-NLP/opus-mt-{source_lang}-{target_lang}" (e.g. "Helsinki-NLP/opus-mt-en-fr"). Use this to specify a different translation model, such as "facebook/nllb-200-distilled-600M" for broader multilingual coverage.
source_langNoISO 639-1 two-letter source language code. Default: "en" (English). Change if the input text is in a language other than English (e.g. "fr" for French input, "es" for Spanish input). A Helsinki-NLP/opus-mt model must exist for the source→target language pair.
target_langYesISO 639-1 two-letter target language code (e.g. "fr" for French, "es" for Spanish, "de" for German, "pt" for Portuguese, "it" for Italian, "nl" for Dutch, "ru" for Russian, "zh" for Chinese, "ja" for Japanese, "ar" for Arabic, "ko" for Korean, "hi" for Hindi). Must have an available Helsinki-NLP/opus-mt model for the source→target pair.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent only when the call failed. Includes error code, message, request_id, and any provider-specific extras.
resultNoTool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior. The description adds valuable context beyond those annotations by explaining the adapter's automatic model selection mechanism ('The adapter automatically selects the opus-mt-{source}-{target} model') and the breadth of language pairs covered. This gives the agent insight into how the tool behaves internally without contradicting any annotation.

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 three sentences, front-loads the core action, and wastes no words. It includes specific examples of language pairs and a brief use case statement without padding. It could be trimmed slightly, but it is compact and informative.

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

Completeness4/5

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

For a translation tool with four parametershol (two required), a rich input schema, an output schema present, and clear annotations, the description is largely complete. It explains the model family, auto-selection, and language pair coverage. It does not mention edge cases like unsupported language pairs, but that constraint is already in the schema, so the description covers the essentials.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds only marginal value beyond the schema: it repeats the ISO 639-1 example codes and mentions the automatic model selection, which is already implied by the model parameter description. It does not introduce new parameter semantics beyond what the schema already documents.

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 action and resource: 'Translate text between languages using the Helsinki-NLP opus-mt model family via HuggingFace Inference API.' It distinguishes from non-translation NLP tasks by focusing on translation and specifying the model family rotation. However, it does not explicitly differentiate from sibling translation tools like 'translate.text.translate', so it misses the strongest level of distinction.

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 includes a vague use case sentence ('Useful for multilingual content pipelines, localization, and cross-language information retrieval') but gives no guidance on when to choose this tool over alternatives, no exclusions, and no mention of simpler translation utilities in the sibling list. An agent would have to infer the intended use case from the model-specific language.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.