Canonical Definition
{
"function": {
"description": "Execute a block of Python/Rust code in a secure sandbox. Returns stdout. IF your code generates an image, video, or audio file, YOU MUST use an ABSOLUTE PATH (e.g., /tmp/my_plot.png) when saving it. In your final Markdown reply, you MUST embed the image using standard markdown syntax with the ABSOLUTE PATH: . DO NOT use relative paths! Imaginclaw will intercept this markdown tag and send the media byte-stream directly to the user.",
"name": "run_code",
"parameters": {
"properties": {
"code": {
"description": "The raw code string to execute.",
"type": "string"
},
"language": {
"description": "The programming language to use (e.g., 'python', 'rust').",
"type": "string"
},
"packages": {
"description": "Optional: List of system packages or Cargo crates to install before execution (e.g., ['matplotlib', 'numpy'] or ['rand', 'image']).",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"language",
"code"
],
"type": "object"
}
},
"type": "function"
}