hf_inference.nlp.translate
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", "...
This record as markdown: /tools/io-github-whiteknightonhorse-apibase/hf-inference.nlp.translate.md
What hf_inference.nlp.translate does on Apibase
AI agents invoke hf_inference.nlp.translate to trigger actions in Apibase. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Input text to process. Maximum ~10,000 characters depending on model context window. |
model | string | — | Override the HuggingFace model ID for translation. If omitted, the adapter automatically selects "Helsinki-NLP/opus-mt-{source_lang}-{target_lang}" (e.g. "Helsi |
source_lang | string | — | ISO 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, "e |
target_lang | string | Yes | ISO 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" |
Parameters from the server's own tool schema.
Why hf_inference.nlp.translate is rated High
Triggers external API call to run an NLP model; effects depend on input arguments.
From the tool's definition Translate text between languages via HuggingFace Inference API
Attacks that exploit this kind of access
The rule that runs hf_inference.nlp.translate safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Apibase, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For hf_inference.nlp.translate, this is the rule to start with:
hf_inference.nlp.translate stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Apibase, apply this rule, and every hf_inference.nlp.translate call is checked against it from then on.
Questions about hf_inference.nlp.translate
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. It is categorised as a Execute tool in the Apibase MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
hf_inference.nlp.translate accepts 4 parameters: text, model, source_lang, target_lang. Required: text, target_lang. The full parameter table on this page comes from the server's own tool schema.
Register the Apibase MCP server in PolicyLayer and add a rule for hf_inference.nlp.translate: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Apibase. Nothing to install.
hf_inference.nlp.translate is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the hf_inference.nlp.translate rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for hf_inference.nlp.translate. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
hf_inference.nlp.translate is provided by the Apibase MCP server (apibase-mcp-client). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Apibase, and thousands of servers like it.
Across the catalogue