Code Interpreter Tool
This tool allows your agent to execute and interpret code in multiple programming languages within an isolated environment, enabling safe code analysis, computation, and problem-solving capabilities directly within conversations.


Parameters
| Name | Description | Possible Values | Required |
|---|---|---|---|
| language | Programming language of the code to execute. Choose from: python, ts, java, r, or bash. | 'python', 'ts', 'java', 'r', 'bash' | Yes |
| code | The code to execute in a single call | Any valid code string in the specified language | Yes |
| timeout | Timeout in seconds for code execution. Minimum 10, maximum 120 seconds. | Number between 10 and 120 | Yes |
When to use this tool
Use this tool when you want to give your agent the ability to interpret and analyze code safely in an isolated environment. This is particularly useful for:
- Data analysis and visualization: Process datasets, generate charts, and perform statistical analysis
- Code analysis and debugging: Analyze code behavior, identify issues, and understand logic flow in a safe environment
- Algorithm testing and validation: Test code snippets, algorithms, or logic to verify their correctness
- Educational assistance: Demonstrate programming concepts, explain code behavior, or provide interactive coding examples
- Code interpretation: Understand what code does without affecting external systems or files
The tool interprets code across multiple programming languages (Python, TypeScript, Java, R, Bash) with configurable execution timeouts, ensuring safe code interpretation without external system impact.