RWS Logo
Show / Hide Table of Contents

Tools Reference

This page documents each MCP tool exposed by the Language Weaver MCP server.

Shared behavior

  • accountId is resolved from the authenticated caller and is never passed as a tool argument.
  • groupId is optional on first call. If the caller belongs to multiple groups, the server requests an explicit group selection.
  • Use Language Weaver 3-letter language codes (for example eng, fra, ger). See Language Codes.

Automatic source language detection

When sourceLanguageId is set to auto, model is ignored even if specified. A language pair that matches the detected source language and the specified target language is selected automatically.

The selected language pair is the first one in alphabetical order available in your account that matches the selection. For example, if the detected source language is eng, the target language is fra, and your account has subscriptions to EngFra-Generic, EngFra-Sports and EngFra-Sports123, the language pair selected is EngFra-Generic.

Because the pair — and therefore the model — is chosen for you, use an explicit sourceLanguageId together with model whenever a specific model is required.

Note

Image input formats cannot be translated with sourceLanguageId: "auto". For those, supply an explicit sourceLanguageId and model.

Input validation

Arguments are validated by the MCP server before any request reaches Language Weaver. A failure returns VALIDATION_ERROR with a message naming the parameter at fault, and nothing is submitted.

Rule Applies to
sourceLanguageId and targetLanguageId are required and must be codes returned by lw_get_language_codes. sourceLanguageId may also be auto. both translation tools
sourceLanguageId and targetLanguageId must be different, unless sourceLanguageId is auto. both translation tools
model is required whenever sourceLanguageId is an explicit code. both translation tools
qualityEstimation must be 0 or 1. both translation tools
translationMode must be quality or speed. both translation tools
input is required, must contain at least one entry, and no entry may be blank. lw_translate_text
inputContent is required, must be valid Base64, and must not decode to an empty file. lw_translate_file
fileName is required and must not contain a directory path (/ or \), quotes, or line breaks. Pass the file name only. lw_translate_file
pdfConverter must be STANDARD, ABBYY or SMART_SELECTION. lw_translate_file
requestId is required and must not be blank. status, result and cancel tools

Format combinations are validated before the file is uploaded. When inputFormat is supplied, the server checks it — and outputFormat, if given — against the lw_get_document_types mapping first. An unsupported inputFormat, or an outputFormat that is not valid for it, therefore fails immediately with the supported values listed in the message, rather than after a long upload. The same check rejects an image inputFormat combined with sourceLanguageId: "auto".

Cached reference data

Reference data is cached by the server for 1 hour by default:

  • the lw_get_document_types mapping;
  • the language pairs subscribed per account and group, used by lw_get_account_language_pairs and by language pair validation.

A subscription change made in Language Weaver can therefore take up to that long to be reflected in tool results.

lw_translate_text

Description
Submit one or more text strings for translation.

Arguments

Name Required Default Description
input yes none Array of source strings.
sourceLanguageId yes none Source language code or auto.
targetLanguageId yes none Target language code.
model no* none Model name (for explicit source language).
qualityEstimation* no 0 Numeric value specifying whether or not quality estimation should be computed.
0 - without quality estimation
1 - with quality estimation
translationMode no quality quality or speed.
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Group to run under when needed.

* model - required when sourceLanguageId is explicit (not auto).
* groupId - required when the caller belongs to multiple groups.
* qualityEstimation - in order to use quality estimation, the corresponding feature needs to be enabled on the account. The feature is available only for the language pairs that have the genericqe model.

Response

{ "requestId": "..." }

Example prompt
Using Language Weaver, translate "good morning" to French.

Tip
Use sourceLanguageId: "auto" unless the user explicitly requires a fixed source language.

lw_translate_file

Description
Submit Base64 file content for translation.

Arguments

Name Required Default Description
inputContent yes none Base64-encoded file bytes.
fileName yes none File name including extension. Must not contain a path; pass the file name only.
sourceLanguageId yes none Source language code or auto.
targetLanguageId yes none Target language code.
model no* none Model name (for explicit source language).
inputFormat no none Input format (DOCX, PDF, PLAIN, etc.).
outputFormat no Default output format based on request input format Desired output format supported for this input format.
qualityEstimation* no 0 Numeric value specifying whether or not quality estimation should be computed.
0 - without quality estimation
1 - with quality estimation
translationMode no quality quality or speed.
pdfConverter no STANDARD STANDARD, ABBYY, or SMART_SELECTION (PDF only).
includeTextContent no false Include plain-text output (true/false).
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Group to run under when needed.

* model is required when sourceLanguageId is explicit (not auto).
* groupId is required when the caller belongs to multiple groups.
* qualityEstimation - in order to use quality estimation, the corresponding feature needs to be enabled on the account. The feature is available only for the language pairs that have the genericqe model.

Response

{ "requestId": "..." }

Example prompt
Using Language Weaver, translate the example.docx file from Downloads from English to German.

Tip
Call lw_get_document_types first to validate inputFormat/outputFormat combinations.

lw_get_translation_status

Description
Check the status of a submitted translation request.

Arguments

Name Required Default Description
requestId yes none Request ID from lw_translate_text or lw_translate_file.
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Same group used when submitting the request.

* groupId is required when the caller belongs to multiple groups.

Response

{
  "translationStatus": "INIT|TRANSLATING|DONE|FAILED|CANCELLED",
  "translationProgressPercent": 0
}

Example prompt
Check the status of request <requestId>.

Tip
Poll every ~2 seconds while status is INIT or TRANSLATING.

lw_get_translation_result

Description
Fetch the finished translation result for a DONE request.

Arguments

Name Required Default Description
requestId yes none Completed request ID.
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Same group used when submitting the request.

* groupId is required when the caller belongs to multiple groups.

Response

  • Text translation: JSON translation payload.
  • File translation:
{ "requestId": "...", "content": "<base64>" }

Example prompt
Get the translation result for request <requestId>.

Tip
Do not call before status is DONE.

lw_cancel_translation

Description
Cancel an in-progress translation request.

Arguments

Name Required Default Description
requestId yes none Request ID to cancel.
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Same group used when submitting the request.

* groupId is required when the caller belongs to multiple groups.

Response

{ "requestId": "..." }

Example prompt
Cancel translation request <requestId>.

lw_get_account_language_pairs

Description
List active language pairs available to the caller (for the selected group).

Arguments

Name Required Default Description
groupId no* Auto-resolved when the caller belongs to one group; required when the caller belongs to multiple. Group to resolve language pairs for.

* groupId is required when the caller belongs to multiple groups.

Response
Language Weaver language pair list including available models.

Example prompt
List available language pairs for my account.

Tip
Run this before translation to validate source/target/model availability.

lw_get_document_types

Description
List supported document input/output types and valid mappings.

Arguments
None (no arguments; no defaults apply).

Response

A documentTypes array. Each entry describes one input document type and the output formats available for it:

{
  "documentTypes": [
    {
      "inputType": "...",
      "inputFormats": ["..."],
      "outputTypes": ["..."],
      "defaultOutputType": "...",
      "formatMappings": [
        { "inputFormat": "...", "outputType": "...", "outputFormat": "..." }
      ]
    }
  ]
}
Field Description
inputType The document type category, for example a text or image type.
inputFormats The values accepted for inputFormat on lw_translate_file for this type.
outputTypes The output document type categories available for this input type.
defaultOutputType The output type used when outputFormat is omitted.
formatMappings The exact valid inputFormat → outputFormat combinations.

The result is the same for every account and is cached by the server, so a newly added format may take up to the cache lifetime to appear. See also Formats Mapping.

Example prompt
List document types and allowed output formats.

Tip
Use this output to prevent format errors before uploading files. The server validates the inputFormat/outputFormat combination against this list before the file is uploaded, so an unsupported combination fails immediately rather than after a long upload.

lw_get_language_codes

Description
Return Language Weaver language codes and language names.

Arguments
None (no arguments; no defaults apply).

Response

{
  "note": "These are the only language codes Language Weaver accepts. ...",
  "source": "https://developers.languageweaver.com/api/lw/common/language-codes.html",
  "languages": [
    { "name": "French", "code": "fra" },
    { "name": "German", "code": "ger" }
  ]
}
Field Description
note Usage guidance for the calling client: copy codes exactly and never derive them from a language name.
source Link to the published language code reference.
languages The complete code table. Each entry has the English name and the 3-letter Language Weaver code.

The result is the same for every account. Use lw_get_account_language_pairs to find out which of these languages the account is actually subscribed to.

Example prompt
Show Language Weaver language codes for French and German.

Tip
Always use codes from this tool exactly as returned. The codes are specific to Language Weaver and do not always match other standards — German is ger, for example. See Language Codes.

In this page
Back to top