Draft a script in the target language
port_draftConverts 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
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Target (without a plan): godot-csharp or unity. | |
| all | No | With planId: draft every waiting GDScript unit in one call (returns a summary per unit, not the code). | |
| out | No | Output file (without a plan; default workspace/drafts/<Class>.cs). | |
| file | No | A .gd file (without a plan). | |
| name | No | Class name (default: the file name in PascalCase). | |
| unit | No | Unit id (u001…), or its source/target path. Omit for the next unit in dependency order. | |
| planId | No | Port plan id from port_plan (port_status lists them). |