treesitter_get_dependencies
Extract all imports and includes from a source file to list its dependencies. Supports Python and C/C++ files, with optional output to a file.
Instructions
Extract all dependencies (imports/includes) from a source file.
Args: file_path: Path to the source code file output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.
Returns: List of dependency strings: - For Python: import module names - For C/C++: included file paths (without quotes/brackets) OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| output_file | No |