(data []byte)
| 1021 | activated = append(activated, name) |
| 1022 | schema, _ := jsonMarshalCompact(tool.ToAPISchema()["input_schema"]) |
| 1023 | lines = append(lines, "## "+name) |
| 1024 | lines = append(lines, "Description: "+tool.Description()) |
| 1025 | lines = append(lines, "Arguments: "+schema) |
| 1026 | lines = append(lines, "") |
| 1027 | } else { |
| 1028 | notFound = append(notFound, name) |
| 1029 | } |
| 1030 | } |
| 1031 | var parts []string |
| 1032 | if len(activated) > 0 { |
| 1033 | parts = append(parts, fmt.Sprintf("Activated %d tool(s): %s. They are now available for use.\n", len(activated), strings.Join(activated, ", "))) |
| 1034 | parts = append(parts, lines...) |
| 1035 | } |
| 1036 | if len(alreadyActive) > 0 { |
| 1037 | parts = append(parts, "Already active: "+strings.Join(alreadyActive, ", ")) |
| 1038 | } |
| 1039 | if len(notFound) > 0 { |
| 1040 | var suggestions string |
| 1041 | candidates := registry.GetDeferredToolNames() |
| 1042 | if len(candidates) > 0 { |
| 1043 | sort.SliceStable(candidates, func(i, j int) bool { |
| 1044 | return toolSearchSimilarity(candidates[i], notFound[0]) > toolSearchSimilarity(candidates[j], notFound[0]) |
| 1045 | }) |
| 1046 | if len(candidates) > 5 { |
| 1047 | candidates = candidates[:5] |
| 1048 | } |
| 1049 | if len(candidates) > 0 { |
| 1050 | suggestions = "Available deferred tools (use select: to load): " + strings.Join(candidates, ", ") |
| 1051 | } |
| 1052 | } |
| 1053 | if suggestions != "" { |
no outgoing calls
no test coverage detected