Skip to main content
Glama

ai_code_convert

Read-only

AI code converter (language to language) — Convert code between languages (python, javascript, typescript, java, csharp, go, rust, ruby, php, kotlin, swift, c, cpp, sql, bash). Source language auto-detected (or from=). Returns the converted code as plain text, the model's notes on behavior differences, and offline checks: detected output language vs target, leftover source-language syntax, TODO markers, line ratio, plus an OK/REVIEW verdict. Up to 12,000 chars. 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_convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYese.g. javascript
codeYese.g. def add(a, b): return a + b

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses what comes back (converted code as plain text, model notes on behavioral differences, offline checks for output language, leftover source syntax, TODO markers, line ratio and an OK/REVIEW verdict), a hard input ceiling of 12,000 chars, the backing model provider, and a per-call price of $0.01 USDC via x402. That is unusually rich behavioral and cost information for a tool with no output schema, and none of it repeats the annotations.

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?

The purpose is front-loaded in the first clause, followed by languages, outputs, limits and pricing in a compact run of sentences with no filler. The parenthetical language list is long but each entry is functional, so nothing substantial is wasted.

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

Completeness4/5

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

For a single-shot conversion tool with no output schema, the description covers return shape, size limit, and payment requirement, which is most of what an agent needs before calling. It omits failure behavior (what happens on unsupported language pairs or over-limit input) and the mechanics of satisfying the x402 payment, leaving modest gaps.

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

Parameters2/5

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

Schema coverage is already 100%, so the baseline would be 3, but the description actively misleads by referring to a 'from=' parameter that does not exist in the input schema, which only defines 'code' and 'to'. An agent could attempt to pass an unsupported argument; the genuinely useful detail (source language auto-detection) is buried in that same misleading clause.

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?

The description states a concrete verb and resource ('Convert code between languages') and enumerates the supported language set, so the agent knows exactly what the tool produces. It does not distinguish itself from the close sibling ai_code_translate, which an agent could easily confuse with a code-conversion tool.

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

Usage Guidelines3/5

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

Usage is implied by the enumeration of languages and the note that source language is auto-detected, giving the agent enough to know this is the right tool for a language-to-language rewrite. There is no explicit when-not guidance and no pointer to alternatives such as ai_code_review or ai_code_translate for the cases where the user wants review rather than conversion.

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