add_parameter
Add one parameter to an existing function signature without retyping it, placing it at the start or end while respecting language-specific trailing parameters.
Instructions
Add one parameter to a function's signature, keeping the body. "end"
puts it after the last parameter but before those that must come after
it (Python **kwargs, a JS/TS rest parameter, Go and Java variadics,
C/C++ ..., Ruby **opts and &blk); "start" before the first, but
after a TS this or Java receiver parameter. A list written one
parameter per line gets it on a line of its own, a C (void) takes it
in place of void, and a bare JS/TS arrow parameter gets parentheses.
A name the function already has is refused.
Use this when: adding a parameter without retyping the signature. Don't use this when: rewriting the signature (replace_signature), or changing the body too (replace_function).
Example (def f(a, **kw) becomes def f(a, b, **kw)):
target="f"
parameter="b"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Function or method name as list_symbols lists it, dotted for nesting ('LRUCache.get'); overloads take parameter types ('A.m(int)'). | |
| position | No | 'end' (default) after the last parameter, before any that must stay last; 'start' before the first. Other values are refused. | end |
| file_path | Yes | Absolute path to the source or config file. | |
| parameter | Yes | Source text of one parameter (e.g. 'default=None', 'const int* buf'); the comma is added for you. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |