edit_file_long_context

Edit a file based on provided instructions.

Arguments

Name
Type
Description
Required

path_to_file

string

The path to the file that needs editing, relative to the project root.

edit_prompts

prompt array

Instructions on how to edit the file. Should be a list of instructions.

modify_with_diff

boolean

Whether to edit code with diff or with a full rewrite. Useful for additions, less so for deletions or complex refactors.

must_exist

boolean

Whether the file must exist. If set to true, and the file does not exist, the tool will return an error.

fail_if_already_edited

boolean

Whether to fail if the file has already been edited. If set to true, and the file has already been edited, the tool will return an error.

Returns

Type
Description

string

The path to the edited file.

Example

- name: edit_file
  arguments:
    path_to_file: <relative-path-to-file>
    edit_prompt: <edit-instructions>
    modify_with_diff: <true/false>
    must_exist: <true/false>
    fail_if_already_edited: <true/false>
  returns: <path-to-edited-file>

Last updated