Skip to main content
Glama
translated

Lara Translate MCP Server

by translated

delete_translation

Destructive

Remove a translation unit from your Lara Translate translation memory by providing its ID, source, target, sentence, and translation.

Instructions

Deletes a translation from a translation memory in your Lara Translate account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID or list of IDs where to delete the translation unit from. Format: mem_xyz123
sourceYesThe source language code of the sentence
targetYesThe target language code of the translation
sentenceYesThe source sentence
translationYesThe translated sentence
tuidNoTranslation Unit unique identifier
sentence_beforeNoThe sentence before the source sentence to specify the context of the translation unit
sentence_afterNoThe sentence after the source sentence to specify the context of the translation unit

Implementation Reference

  • The main handler function that executes the delete_translation tool logic. Validates input with Zod schema, then calls lara.memories.deleteTranslation with either a simple (without tuid) or contextual (with tuid, sentence_before, sentence_after) variant.
    export async function deleteTranslation(args: any, lara: Translator) {
      const validatedArgs = deleteTranslationSchema.parse(args);
      const {
        id,
        source,
        target,
        sentence,
        translation,
        tuid,
        sentence_before,
        sentence_after,
      } = validatedArgs;
    
      if (!tuid) {
        return await lara.memories.deleteTranslation(
          id,
          source,
          target,
          sentence,
          translation
        );
      }
    
      if (
        (sentence_before && !sentence_after) ||
        (!sentence_before && sentence_after)
      ) {
        throw new InvalidInputError("Please provide both sentence_before and sentence_after");
      }
    
      return await lara.memories.deleteTranslation(
        id,
        source,
        target,
        sentence,
        translation,
        tuid,
        sentence_before,
        sentence_after
      );
    }
  • Zod schema defining the input validation for delete_translation: id (array of strings), source (string), target (string), sentence (string), translation (string), tuid (optional string), sentence_before (optional string), sentence_after (optional string).
    export const deleteTranslationSchema = z.object({
      id: z
        .array(z.string())
        .describe(
          "The ID or list of IDs where to delete the translation unit from. Format: mem_xyz123"
        ),
      source: z.string().describe("The source language code of the sentence"),
      target: z.string().describe("The target language code of the translation"),
      sentence: z.string().describe("The source sentence"),
      translation: z.string().describe("The translated sentence"),
      tuid: z.string().describe("Translation Unit unique identifier").optional(),
      sentence_before: z
        .string()
        .describe(
          "The sentence before the source sentence to specify the context of the translation unit"
        )
        .optional(),
      sentence_after: z
        .string()
        .describe(
          "The sentence after the source sentence to specify the context of the translation unit"
        )
        .optional(),
    });
  • src/mcp/tools.ts:48-68 (registration)
    Registration of the delete_translation handler in the handlers record (line 55) mapping the string 'delete_translation' to the deleteTranslation function.
    const handlers: Record<string, Handler> = {
      detect_language: detectLanguage,
      translate: translateHandler,
      create_memory: createMemory,
      delete_memory: deleteMemory,
      update_memory: updateMemory,
      add_translation: addTranslation,
      delete_translation: deleteTranslation,
      import_tmx: importTmx,
      check_import_status: checkImportStatus,
      get_glossary: getGlossary,
      create_glossary: createGlossary,
      update_glossary: updateGlossary,
      delete_glossary: deleteGlossary,
      import_glossary_csv: importGlossaryCsv,
      check_glossary_import_status: checkGlossaryImportStatus,
      export_glossary: exportGlossary,
      get_glossary_counts: getGlossaryCounts,
      add_glossary_entry: addGlossaryEntry,
      delete_glossary_entry: deleteGlossaryEntry,
    };
  • Tool definition including name ('delete_translation'), description, inputSchema (via z.toJSONSchema), and annotations marking it as destructive (destructiveHint: true).
    {
      name: "delete_translation",
      description:
        "Deletes a translation from a translation memory in your Lara Translate account.",
      inputSchema: z.toJSONSchema(deleteTranslationSchema),
      annotations: {
        title: "Delete translation unit from memory",
        readOnlyHint: false,
        destructiveHint: true,
        openWorldHint: false,
      },
    },
  • src/mcp/tools.ts:18-21 (registration)
    Import of the deleteTranslation function and deleteTranslationSchema from the delete_translation module.
    import {
      deleteTranslation,
      deleteTranslationSchema,
    } from "./tools/delete_translation.js";
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already indicate destructiveHint=true, so the destructive nature is known. The description adds no extra behavioral details (e.g., permanence, permissions, side effects) beyond the annotation. With annotations, a 3 is appropriate as it doesn't contradict but also doesn't add value.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence of 14 words with no redundancy. It is appropriately front-loaded and concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite annotations, the description is incomplete given the tool's complexity (8 params, destructive, no output schema). It does not explain behavior for multiple IDs, return values, or deletion effects. More context is needed for a complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with each parameter described adequately. The description does not add new meaning beyond the schema, so the baseline of 3 is justified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Deletes), the resource (translation from a translation memory), and the context (Lara Translate account). It is specific and distinguishes from siblings like add_translation or delete_memory.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, nor does it state prerequisites or usage context. It is a simple declarative statement without usage differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/translated/lara-mcp'

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