()
| 14 | func init() { Default.Register(&WriteFileTool{}) } |
| 15 | |
| 16 | func (WriteFileTool) Definition() api.ToolDef { |
| 17 | return api.ToolDef{ |
| 18 | Name: "write_file", |
| 19 | Description: "Write content to a file at the given path. Creates or overwrites.", |
| 20 | InputSchema: map[string]any{ |
| 21 | "path": map[string]any{ |
| 22 | "type": "string", |
| 23 | "description": "Path to the file to write.", |
| 24 | }, |
| 25 | "content": map[string]any{ |
| 26 | "type": "string", |
| 27 | "description": "The content to write.", |
| 28 | }, |
| 29 | }, |
| 30 | Required: []string{"path", "content"}, |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func (WriteFileTool) Execute(_ context.Context, rawInput string) (string, bool) { |
| 35 | var in struct { |
nothing calls this directly
no outgoing calls
no test coverage detected