Skip to main content
Glama

Draft a script in the target language

port_draft

Converts a GDScript file into C# as a first draft, parsing classes, signals, and engine API calls so you review generated code instead of writing every line.

Instructions

Translates a GDScript file to C# as a first draft, so the agent reviews code instead of writing every line. The script is parsed, not pattern-replaced: classes, exports, signals (declare, connect, emit, await), typed and inferred variables, functions with defaults, if/for/while/match, ternaries, string formatting, lambdas, node paths and inner classes. Names resolve against the script's own members, the engine API (inherited methods, properties and signals), the scenes that use the script (the node type behind each $Path) and the project's autoloads. Godot C#: the API keeps its meaning in PascalCase, so most lines carry over. Unity: structure, lifecycle (Awake/Update/FixedUpdate), events, math and logic carry over; every Godot API call stays visible with a PORT: comment and the API map's advice. Nothing is dropped silently: what cannot be translated stays in place as a comment. With planId (+unit, or all:true for every waiting script) it writes the unit's target and marks it partial; review it and finish with port_write. With file+to it writes into the workspace. The draft is unbuilt code: compile it in the target engine.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "port_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoTarget (without a plan): godot-csharp or unity.
allNoWith planId: draft every waiting GDScript unit in one call (returns a summary per unit, not the code).
outNoOutput file (without a plan; default workspace/drafts/<Class>.cs).
fileNoA .gd file (without a plan).
nameNoClass name (default: the file name in PascalCase).
unitNoUnit id (u001…), or its source/target path. Omit for the next unit in dependency order.
planIdNoPort plan id from port_plan (port_status lists them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.25.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only declare it is a non-destructive write; the description adds the important traits: parsing rather than pattern replacement, nothing dropped silently (untranslatable code becomes comments), that plan mode marks the unit partial, and that output is unbuilt code needing compilation. That is genuine value beyond annotations, though permissions/overwrite behavior on file+to output is not stated.

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?

Front-loaded with purpose and the review workflow, then modes, then engine-specific expectations. The long enumerated list of parsed constructs is the densest part and borders on padding, but it substantiates the parsing claim and justifies trusting the draft.

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?

A 7-parameter, no-required-argument tool with no output schema is well covered: both modes, defaults deferred to the schema, engine-specific outcomes for Godot C# and Unity, and the partial-unit contract. The only gap is what a non-plan call returns (path, stats, or nothing) beyond the one note about all:true summaries.

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?

With 100% schema coverage the baseline is 3, but the description adds combinatorial meaning the schema does not: planId pairs with unit or all:true, file pairs with to, and what 'all' returns (a summary per unit, not the code). The implicit mode exclusivity is conveyed by the repeated 'without a plan' phrasing.

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?

States a specific verb and resource — translates a GDScript file into a C# first draft — and immediately frames the agent's role ('reviews code instead of writing every line'). The distinction from port_write (which finishes the partial unit) is explicit, so an agent can separate it from the other port_* siblings.

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

Usage Guidelines5/5

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

Gives two concrete invocation modes with selection criteria: planId (+unit, or all:true for every waiting unit) versus file+to for workspace output. It also names the follow-up tool ('review it and finish with port_write'), so the workflow position is unambiguous.

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