Skip to main content
Glama
ClawyPro

Clawy MCP Server

by ClawyPro

deepl_translate

Translate text between 30+ languages using DeepL's neural machine translation. Specify target language, optional source language, and formality level for natural-sounding output.

Instructions

Translate text using DeepL neural machine translation. Supports 30+ languages with high-quality, natural-sounding output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to translate
target_langYesTarget language code (e.g., EN, KO, JA, DE, FR, ES, ZH)
source_langNoSource language code (auto-detected if omitted)
formalityNoFormality level (not all languages support this)

Implementation Reference

  • The tool execution handler in src/index.ts iterates through all registered tools (including deepl_translate) and executes them by making a call to gatewayRequest using the endpoint defined in the tool definition.
    // Register all tools
    for (const tool of allTools) {
      server.tool(
        tool.name,
        tool.description,
        tool.inputSchema.shape,
        async (params) => {
          const method = tool.method || "POST";
          const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>);
    
          if (result.error) {
            return {
              content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }],
              isError: true,
            };
          }
    
          const text = typeof result.data === "string"
            ? result.data
            : JSON.stringify(result.data, null, 2);
    
          return {
            content: [{ type: "text" as const, text }],
          };
        },
      );
    }
  • Input schema definition for the deepl_translate tool.
    inputSchema: z.object({
      text: z.string().describe("Text to translate"),
      target_lang: z.string().describe("Target language code (e.g., EN, KO, JA, DE, FR, ES, ZH)"),
      source_lang: z.string().optional().describe("Source language code (auto-detected if omitted)"),
      formality: z.enum(["default", "more", "less", "prefer_more", "prefer_less"]).optional()
        .describe("Formality level (not all languages support this)"),
    }),
  • Definition and registration of the deepl_translate tool.
    export const deeplTools: ToolDef[] = [
      {
        name: "deepl_translate",
        description: "Translate text using DeepL neural machine translation. Supports 30+ languages with high-quality, natural-sounding output.",
        inputSchema: z.object({
          text: z.string().describe("Text to translate"),
          target_lang: z.string().describe("Target language code (e.g., EN, KO, JA, DE, FR, ES, ZH)"),
          source_lang: z.string().optional().describe("Source language code (auto-detected if omitted)"),
          formality: z.enum(["default", "more", "less", "prefer_more", "prefer_less"]).optional()
            .describe("Formality level (not all languages support this)"),
        }),
        endpoint: "/v1/deepl/translate",
      },
    ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ClawyPro/clawy-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server