| 152 | type EditFileTool struct{ BaseTool } |
| 153 | |
| 154 | func NewEditFileTool() *EditFileTool { |
| 155 | return &EditFileTool{BaseTool{Spec: ToolSpec{ |
| 156 | Name: "edit_file", |
| 157 | Description: "Perform exact string replacement in an existing file. By default, old_string must appear exactly once in the file. Use replace_all=true to substitute every occurrence.", |
| 158 | InputPrototype: EditFileInput{}, |
| 159 | ReadOnly: BoolPtr(false), |
| 160 | ConcurrencySafe: BoolPtr(false), |
| 161 | Destructive: BoolPtr(false), |
| 162 | ConfirmFilePaths: true, |
| 163 | }}} |
| 164 | } |
| 165 | |
| 166 | func (t *EditFileTool) ValidateInput(execCtx ExecutionContext, input any) (bool, string) { |
| 167 | in := deref[EditFileInput](input) |