set_code
Replaces the open MakeCode project's entire program with TypeScript, shows it as blocks, and compiles it, returning errors and whether block conversion succeeded.
Instructions
Replace the open project's whole program with MakeCode TypeScript, show it as blocks, and compile it. Returns compile errors (fix and call again until errors is empty) and whether it converted to blocks. Overwrites the program: call get_code first if it may hold the user's work, or use new_project.
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": "set_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Complete MakeCode TypeScript program (replaces main.ts) | |
| view | No | Editor view to show afterwards. Default blocks (falls back to javascript if the code has no block form) |