delete_symbol
Remove entire functions or classes from source code files using AST-based editing to delete symbols and their decorators cleanly.
Instructions
Delete an entire function or class definition, including its decorators.
Use this when: You want to remove a function, method, or class entirely from a
source file.
Don't use this when: You want to remove a config key -> use delete_key. You
want to remove an import -> use remove_import. You want to remove lines
inside a function -> no dedicated tool yet; use replace_function_body to
rewrite the body without the unwanted lines.
Example: target="LRUCache.old_method" # deletes a method target="DeprecatedClass" # deletes a whole class (and all its methods)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |