insert_before
Insert code as a sibling before a named symbol like functions or classes in AST-based files. Use for precise placement when adding helpers before callers or constants above dependent code.
Instructions
Insert content as a sibling immediately before a named symbol (function, class, method, or top-level assignment).
Use this when: You need precise placement relative to another symbol (e.g.
inserting a helper function just before its caller, or a constant above a class
that uses it).
Don't use this when: You just want to append to the end of the file -> use
add_top_level.
Example: target="LRUCache" content="CACHE_SIZE = 100"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |