detect_language

Pack: libretranslate · Endpoint: https://gateway.pipeworx.io/libretranslate/mcp

Detect the source language of a piece of text. Returns ranked language candidates with confidence.

Parameters

NameTypeRequiredDescription
textstringyesText to analyze

Example call

Arguments

{
  "text": "Bonjour, comment allez-vous?"
}

curl

curl -X POST https://gateway.pipeworx.io/libretranslate/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"detect_language","arguments":{"text":"Bonjour, comment allez-vous?"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('detect_language', {
  "text": "Bonjour, comment allez-vous?"
});

Response shape

Always returns: text, candidates

FieldTypeDescription
textstringText that was analyzed
candidatesarrayRanked language candidates with confidence scores
Full JSON Schema
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Text that was analyzed"
    },
    "candidates": {
      "type": "array",
      "description": "Ranked language candidates with confidence scores",
      "items": {
        "type": "object",
        "properties": {
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Detected language code"
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "description": "Confidence score for this language"
          }
        }
      }
    }
  },
  "required": [
    "text",
    "candidates"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "libretranslate": {
      "url": "https://gateway.pipeworx.io/libretranslate/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 6, 2026