MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / GetDeleteTextFileToolDefinition

Function GetDeleteTextFileToolDefinition

pkg/aiusechat/tools_writefile.go:495–526  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

493}
494
495func GetDeleteTextFileToolDefinition() uctypes.ToolDefinition {
496 return uctypes.ToolDefinition{
497 Name: "delete_text_file",
498 DisplayName: "Delete Text File",
499 Description: "Delete a text file from the filesystem. A backup is created before deletion. Maximum file size: 100KB.",
500 ToolLogName: "gen:deletefile",
501 Strict: true,
502 InputSchema: map[string]any{
503 "type": "object",
504 "properties": map[string]any{
505 "filename": map[string]any{
506 "type": "string",
507 "description": "Absolute path to the file to delete. Supports '~' for the user's home directory. Relative paths are not supported.",
508 },
509 },
510 "required": []string{"filename"},
511 "additionalProperties": false,
512 },
513 ToolCallDesc: func(input any, output any, toolUseData *uctypes.UIMessageDataToolUse) string {
514 params, err := parseDeleteTextFileInput(input)
515 if err != nil {
516 return fmt.Sprintf("error parsing input: %v", err)
517 }
518 return fmt.Sprintf("deleting %q", params.Filename)
519 },
520 ToolAnyCallback: deleteTextFileCallback,
521 ToolApproval: func(input any) string {
522 return uctypes.ApprovalNeedsApproval
523 },
524 ToolVerifyInput: verifyDeleteTextFileInput,
525 }
526}

Callers 1

GenerateTabStateAndToolsFunction · 0.85

Calls 1

parseDeleteTextFileInputFunction · 0.85

Tested by

no test coverage detected