Run Agent Code Node
warning
This node is in beta and may not be fully tested or documented. Use with caution.
Expose an execute_code tool that lets agents execute TypeScript code in a sandbox with access to all connected MCP tools.
Properties
| Label | Property | Type | Description | Default Value | Is Required |
|---|---|---|---|---|---|
| Tool Name | toolNameOverride | botdojo/types/string | Optional. If empty, defaults to "execute_code". | null | ✅ |
| Tool Label | toolLabel | botdojo/types/string | Optional. If empty, defaults to "Execute Code". | null | ✅ |
| Tool Instructions | toolInstructionsOverride | botdojo/types/string | Execute TypeScript code in a sandboxed environment with access to all tools via resource.call(). Provide code inline via 'source' or reference a workspace file via 'sourceFile'. Function signature: typescript<br/>async function execute(input, resource) \{<br/> // input: your input data<br/> // resource: object with call() method for invoking tools<br/>\}<br/>Calling tools: typescript<br/>const result = await resource.call(\{<br/> mcp_uri: "agent://me/TOOLS.md", // Required: URI of the MCP providing the tool<br/> tool_name: "memory_list", // Tool name (with any prefixes)<br/> parameters: \{ // Tool-specific parameters<br/> path: "docs/"<br/> \}<br/>\});<br/>Complete example: typescript<br/>async function execute(input, resource) \{<br/> const processed = input.value * 2;<br/> const memoryFiles = await resource.call(\{<br/> mcp_uri: "agent://me/TOOLS.md",<br/> tool_name: "memory_list",<br/> parameters: \{ path: "docs/" \}<br/> \});<br/> console.log("Files found:", memoryFiles);<br/> return \{ processed, memoryFiles \};<br/>\}<br/>Use dryRun: true to check for compile errors without executing. Returns { output, logs } on success or { output: null, logs, error } on failure. logs contains any console.log/warn/error calls made during execution. | null | ✅ |
| Hide Step in Chat | toolHideStep | botdojo/types/boolean | When enabled, the tool will not be shown to the user in the chat. | false | ✅ |
| Hide Step Details | toolHideStepDetails | botdojo/types/boolean | When enabled, the tool step details will be hidden from the user. | false | ✅ |
Output
| Label | Property | Type | Description | Default Value |
|---|---|---|---|---|
| Tool | tool | botdojo/interface/tool | The execute_code tool | null |