| 113 | type WriteFileTool struct{ BaseTool } |
| 114 | |
| 115 | func NewWriteFileTool() *WriteFileTool { |
| 116 | return &WriteFileTool{BaseTool{Spec: ToolSpec{ |
| 117 | Name: "write_file", |
| 118 | Description: "Create or overwrite a file. Parent directories are created automatically if they do not exist.", |
| 119 | InputPrototype: WriteFileInput{}, |
| 120 | ReadOnly: BoolPtr(false), |
| 121 | ConcurrencySafe: BoolPtr(false), |
| 122 | Destructive: BoolPtr(true), |
| 123 | ConfirmFilePaths: true, |
| 124 | }}} |
| 125 | } |
| 126 | |
| 127 | func (t *WriteFileTool) ValidateInput(execCtx ExecutionContext, input any) (bool, string) { |
| 128 | in := deref[WriteFileInput](input) |