code.setCode
Edit code content in Circuitry's visual workflow platform to modify functions or logic while preserving the node structure, with optional diff review before applying changes.
Instructions
Update code content in a code node. Use showDiff: true to show inline diff UI for user to review/accept changes. If node is EServer-sourced, will sync to source file.
CRITICAL: Use this for "remove/add/change the X function" requests - EDIT the code content, don't delete the node!
"remove the power function" → Get code with code.getCode, then update with code.setCode (function removed)
"delete the node" → Use nodes.delete instead (removes entire node)
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": {
"nodeId": "<nodeId>",
"code": "<code>"
},
"name": "code.setCode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | Code node ID | |
| code | Yes | Source code to set | |
| options | No | Options: { showDiff?: boolean (show diff UI), targetName?: string (display name), source?: string } |