Skip to main content
Glama

ai_code_translate

Read-only

Code translator — Translate source code between programming languages (Python, JavaScript, TypeScript, Go, Rust, Java, C#, Ruby, PHP, Bash and more) into idiomatic target code, keeping behavior and names. Params: code (required, URL-encoded, max 6000 chars), to (required target language), from (optional). Returns plain code, no markdown. Llama 3.3 70B on Workers AI. Price: $0.01 USDC (Base, via x402).

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": {
      "code": "<code>",
      "to": "<to>"
    },
    "name": "ai_code_translate"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesgo
codeYesdef add(a, b): return a + b

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior5/5

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

Beyond the annotations (readOnly, non-destructive, open-world), the description discloses what the annotations cannot: the output is plain code with no markdown fence, the code param must be URL-encoded and is capped at 6000 chars, the backing model is Llama 3.3 70B on Workers AI, and the call costs $0.01 USDC via x402 on Base. Pricing and encoding requirements are exactly the kind of pre-call context an agent needs.

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

Conciseness4/5

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

One front-loaded paragraph: purpose first, then params, then return format, then model and price. Dense but every clause earns its place, with the minor exception of the price detail being glued to the end rather than called out as a precondition. No redundant restatement of the title.

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

Completeness5/5

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

Two required params, no output schema, and the description covers everything an agent needs before invoking: what goes in, encoding and size limits, what comes back, and that the call is paid. Nothing material is left to guesswork for a tool of this complexity.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3, but the description adds real meaning the schema does not carry: 'code' must be URL-encoded and is limited to 6000 chars, 'to' is the target language, and 'from' is optional (presumably inferred). The schema's own examples ('go', 'def add(a, b)...') convey nothing about encoding or limits, so this is genuine added value.

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

Purpose4/5

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

States a specific verb and resource — translating source code between programming languages — and enumerates the supported languages, which is far more specific than the title alone. It implicitly separates itself from natural-language siblings like ai_translate by saying 'source code', but never names an alternative explicitly, so sibling routing still requires a small inference.

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?

There is no explicit when-to-use or when-not-to-use guidance, and no sibling is named as the alternative for adjacent cases (natural-language translation, code review, code explanation). The agent must infer from 'Translate source code' that ai_translate and ai_code_review are not the right picks. It is descriptive of capability but silent on selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources