bluente_translate_file
Start or cancel translation for uploaded files while preserving formatting, supporting multiple languages and translation engines.
Instructions
Start or cancel translation for an uploaded file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "bluente_translate_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| action | No | start | |
| from | No | ||
| to | No | ||
| engine | No | LLM | |
| glossary | No | ||
| custom_glossary | No | ||
| bilingual | No | line | |
| vertical_bilingual | No | ||
| scanned | No | ||
| namespace | No | ||
| metadata | No |
Implementation Reference
- src/tools/translate-file.tool.js:12-32 (handler)The handler function for the `bluente_translate_file` tool, executing `client.translateFile`.
async (args) => executeTool(TOOL_NAME, async () => { if (args.action === "start" && (!args.from || !args.to)) { throw new BluenteApiError("Fields 'from' and 'to' are required when action is 'start'."); } return client.translateFile({ id: args.id, action: args.action, from: args.from, to: args.to, engine: args.engine, glossary: args.glossary, customGlossary: args.custom_glossary, bilingual: args.bilingual, verticalBilingual: args.vertical_bilingual, scanned: args.scanned, namespace: args.namespace, metadata: args.metadata }); }) - src/tools/translate-file.tool.js:7-34 (registration)Registration function for the `bluente_translate_file` tool.
export function registerTranslateFileTool(server, { client }) { server.tool( TOOL_NAME, "Start or cancel translation for an uploaded file.", translateFileSchema, async (args) => executeTool(TOOL_NAME, async () => { if (args.action === "start" && (!args.from || !args.to)) { throw new BluenteApiError("Fields 'from' and 'to' are required when action is 'start'."); } return client.translateFile({ id: args.id, action: args.action, from: args.from, to: args.to, engine: args.engine, glossary: args.glossary, customGlossary: args.custom_glossary, bilingual: args.bilingual, verticalBilingual: args.vertical_bilingual, scanned: args.scanned, namespace: args.namespace, metadata: args.metadata }); }) ); } - src/tools/schemas.js:17-30 (schema)Zod schema definition for input validation of `bluente_translate_file`.
export const translateFileSchema = { id: z.string().min(1), action: z.enum(["start", "cancel"]).default("start"), from: z.string().min(2).optional(), to: z.string().min(2).optional(), engine: engineSchema, glossary: binaryFlagSchema.default(0), custom_glossary: binaryFlagSchema.default(0), bilingual: z.enum(["line", "paragraph", "none"]).default("line"), vertical_bilingual: binaryFlagSchema.default(0), scanned: binaryFlagSchema.default(0), namespace: z.string().optional(), metadata: z.record(z.any()).optional() };