hello_world
Returns a friendly hello world message.
translate_text
Translates text using LILT's instant translate API.
Use this tool when you need to translate text from one language to another
using LILT's neural translation models.
IMPORTANT: Check the 'insufficient_credits' field in the response. If True,
inform the user they don't have enough credits and suggest purchasing more
instant translation credits at https://mcp.lilt.com/home.
If the user has sufficient credits but their balance is running low (5,000
credits or fewer), inform them about the remaining balance and suggest
purchasing more credits to avoid interruptions.
In the response object, if the "used_trained_model" is false, then tell the
user that the translation was done with a LILT base model. If the user
wants to improve the translation quality or match their brand voice they
should create a trained model. Ask the user if they would like to create a
trained model.
Args:
text: The text to translate
src_lang: Source language code (e.g., "en", "es", "fr")
trg_lang: Target language code (e.g., "en", "es", "fr")
Returns:
dict[str, Any]: Translation response containing:
- insufficient_credits (bool): True if user doesn't have enough credits
- credits_balance (int): Remaining credits after translation (or current
balance if insufficient)
- On success (when insufficient_credits=False): Also includes the
translated text and other LILT API response fields
create_trained_model
Creates a new trained translation model for a specific language pair.
Use this tool when a user wants to improve translation quality for a
specific language pair by creating a translation model that can be trained
with their own data. This is a prerequisite for using
`translate_files_with_verification` for that language pair.
Args:
src_lang: The source language formatted as an IETF BCP 47 language tag
(e.g., "en", "es").
trg_lang: The target language formatted as an IETF BCP 47 language tag
(e.g., "fr", "de").
Returns:
None
translate_files_with_verification
Create a verified translation job that will be assigned to professional LILT
linguists for translation and review.
IMPORTANT TWO-STEP WORKFLOW:
STEP 1 - Get Quote (user_confirmed=False, default):
- Call this tool WITHOUT user_confirmed or with user_confirmed=False
- Returns a quote showing credits needed, current balance, and detailed breakdown
- NO job is created, NO credits are deducted
- Show the user the quote and ask for explicit confirmation
STEP 2 - Create Job (user_confirmed=True):
- Only after user explicitly confirms, call this tool again with user_confirmed=True
- Creates the job and deducts credits
- Returns the created job details
Credit Handling:
- If insufficient_credits=True: Inform user they don't have enough credits and
suggest purchasing more at https://mcp.lilt.com/home
- If credits are sufficient but low (10 or fewer): Warn user about low balance
and suggest purchasing more credits
- If credits are sufficient: Show quote details (credits needed, current balance,
balance after) and ASK FOR EXPLICIT CONFIRMATION before proceeding to step 2
If the tool throws a ValueError related to no trained models existing for a
language pair, then tell this to the user and ask if they would like to
create a trained model.
Before Use:
If no file_ids are specified look for previously uploaded files first and run
the `upload_files` tool, if there are no previous files ask the user
to upload a file
Args:
name: A 20 character name for the job summarized from the user's instructions.
src_lang: The source language formatted as an IETF BCP 47 language tag.
file_ids: A list file_ids uploaded to LILT
trg_langs: A list of target languages formatted as an IETF BCP 47 language tag.
user_confirmed: Set to True only after showing quote to user and getting
explicit confirmation. Default is False (quote mode).
Returns (when user_confirmed=False - Quote Mode):
dict: A dictionary containing:
- quote_mode (bool): True, indicating this is a quote
- insufficient_credits (bool): True if user doesn't have enough credits
- credits_balance (int): Current verified translation credit balance
- credits_needed (int): Credits that will be deducted if job is created
- quote_details (list): Detailed token breakdown per file and language pair
- quote_failures (list): Any files that failed to get quoted
Returns (when user_confirmed=True - Job Creation Mode):
dict: A dictionary representing the created job:
- id (int): The job ID
- name (str): The job name
- status (str): The job status
- insufficient_credits (bool): True if user doesn't have enough credits
- credits_balance (int): Remaining credits after job creation
- credits_deducted (int): Credits deducted for this job
- quote_details (list): Detailed breakdown of costs
- quote_failures (list): Any files that failed to get quoted
upload_file
Upload a file to LILT for translation.
This tool handles file uploads. For non-plain-text file formats like PDF,
DOCX, RTF, etc., it assumes the client has extracted the text content.
To indicate that only the text is being used, the tool appends a `.txt`
extension to the original filename (e.g., `report.docx` becomes
`report.docx.txt`).
IMPORTANT: You must inform the user of this behavior. When a user uploads a
file like a PDF or DOCX, confirm by saying: "I am uploading the extracted
text from your file [original_filename] for translation."
Args:
name: Original filename (e.g., "document.txt", "article.md")
content: The raw file content to be uploaded. For non-text files, this
should be the extracted text.
content_type: MIME type (defaults to "text/plain" if not specified)
Returns:
dict: On success, a dictionary with 'id', 'name', and 'status'. On
failure, contains 'error' and 'status'.
get_credit_balance_information
Retrieves all available credit balances for the authenticated user.
Instant credits refresh every month. You get a certain amount to use every month.
Every month the credits refresh.
Verified credits don't expire. Once they are purchased you will always have them.
Use this tool to check the current balance for both instant and verified
translation credits.
Returns:
dict[str, int]: A dictionary representing the credits with the following keys:
- instant_translation(int): The number of instant translation credits
- verified_translation(int): The number of verified translation credits
list_resources
Lists and filters jobs or models.
Args:
resource_type: The type of resource to list. Can be "model" or "job".
archived: For jobs, whether to list archived jobs instead of active ones.
Defaults to False.
Returns:
list[dict[str, Any]]: A list of metadata for the resources.
For "model", each dict contains:
- src_lang (str): The source language.
- trg_lang (str): The target language.
For "job", each dict contains:
- id (int): The job ID.
- name (str): The job name.
- src_lang (str): The source language.
- trg_langs (list[str]): The target languages.
- num_files (int): The number of files in the job.
check_job_status
Checks the status of a verified translation job.
Args:
job_id: The ID of the job to check.
Returns:
dict[str, Any]: A dictionary with the job's status information:
- percent_translated (int): The percentage of segments translated.
- percent_reviewed (int): The percentage of segments reviewed.
- workflow (str): The current workflow status (e.g., "DONE").
- ready_to_download (bool): Whether the job is complete and ready
for download.
download_job
Triggers a job export and returns a download link for the completed job.
Args:
job_id: The ID of the job to download.
Returns:
dict[str, Any]: A dictionary containing the download link:
- download_url (str): A short-lived, secure URL to download the
exported job files.