💻 Code Tools Reference

These tools are designed to help the AI understand the structure of your code and assist with higher-level development tasks.

These tools are designed to help the AI understand the structure of your code and assist with higher-level development tasks.

🏗️ Structure Analysis

view_file_outline

Provides a high-level summary of a file's structure.

  • Capabilities: Detects classes, functions, and their line ranges.
  • UI: Returns a clean table of definitions.
  • Usage: What are the main functions in assistant.py?

view_code_item

Extracts the full definition of specific code elements (classes or functions).

  • Parameters: File path and a list of NodePaths (e.g., MyClass.my_method).
  • Usage: Show me the implementation of the login method in AuthService.

🛡️ Verification & Quality

linter_tool

Runs static analysis on your code to find potential issues.

  • Supported: pylint, flake8, mypy.
  • Usage: Check src/utils.py for any lint errors.

test_generation_tool

Automatically suggests and creates unit tests for a given file.

  • Usage: Generate pytest unit tests for the math_lib module.
  • Action: Analyzes functions and edge cases to build comprehensive test suites.

⚙️ Logic Execution

execute_python

Runs a Python script and captures its output.

  • Parameters: Code to run, Args, and the Environment (Local, Docker, or E2B).
  • Usage: Run the main.py script with the --verbose flag.

run_terminal_command

Executes a generic shell command.

  • Safety: Requires user confirmation in most modes.
  • Usage: Install the pandas library using pip.

💡 AI Strategy

When the AI is asked to "fix a bug," it typically follows this pattern:

  1. view_file_outline to find the relevant code.
  2. view_code_item to understand the logic.
  3. execute_python (in sandbox) to reproduce the error.
  4. replace_file_content to apply the fix.
  5. linter_tool and execute_python to verify the solution.