expand-code
Expands TypeScript macros and @derive decorators to show generated code with diagnostics for debugging and understanding transformations.
Instructions
Expands Macroforge macros in TypeScript code and returns the transformed result.
Shows:
The fully expanded TypeScript code with all generated methods
Any diagnostics (errors, warnings, info) with line/column locations
Help text for fixing issues (when available)
Useful for:
Seeing what code the macros generate
Understanding how @derive decorators transform your classes
Debugging macro expansion issues
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>"
},
"name": "expand-code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | TypeScript code with @derive decorators to expand | |
| filename | No | Filename for the code (default: input.ts) |