prepend_to_body
Insert content at the top of a function body while preserving existing statements. Use for adding logging, input validation, or early-return guards to the beginning of functions.
Instructions
Insert content at the top of a function body, preserving existing statements.
Use this when: You're adding one or two lines at the START of a function (logging,
input validation, early-return guards, debug prints).
Don't use this when: You're replacing the whole body -> use replace_function_body.
You're adding to the bottom -> use append_to_body.
Example: target="LRUCache.get" content=" print(f'get called with {key}')"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |