MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / handleToolSearchQuery

Function handleToolSearchQuery

tools/builtin.go:951–979  ·  view source on GitHub ↗
(query string, registry *ToolRegistry)

Source from the content-addressed store, hash-verified

949 t.sandboxManager.Configure(bashpkg.SandboxOptions{
950 Backend: cfg.SandboxBackend,
951 WSLDistro: cfg.WSLSandboxDistro,
952 WSLInstallDir: cfg.WSLSandboxInstallDir,
953 WSLImageURL: cfg.WSLSandboxImageURL,
954 WSLImagePath: cfg.WSLSandboxImagePath,
955 WSLImageSHA256: cfg.WSLSandboxImageSHA256,
956 WSLAllowLocalFallback: cfg.WSLSandboxAllowLocalFallback,
957 })
958}
959
960func sandboxSetupDecision(execCtx ExecutionContext) string {
961 toolID := stringFromExecCtx(execCtx, "_tool_call_id")
962 if toolID == "" {
963 return ""
964 }
965 if decisions, ok := execCtx["_wsl_sandbox_setup_decisions"].(map[string]string); ok {
966 return decisions[toolID]
967 }
968 return ""
969}
970
971type ToolSearchInput struct {
972 Query string `json:"query" jsonschema:"description=Search query. Use 'select:Name1,Name2' to load specific tools, '+prefix keyword' to filter by name prefix, or just keywords to search all available deferred tools."`
973}
974
975type ToolSearchTool struct{ BaseTool }
976
977func NewToolSearchTool() *ToolSearchTool {
978 return &ToolSearchTool{BaseTool{Spec: ToolSpec{
979 Name: "tool_search",
980 Description: "Search for and load tools that are not in the default tool list. Use this when you need a specific tool that isn't available.\n\nQuery syntax:\n \"select:Name1,Name2\" — directly load specific tools by exact name\n \"+prefix keyword\" — filter tools whose name starts with prefix, ranked by keyword relevance\n \"keyword1 keyword2\" — search all deferred tools by name and description\n\nAfter loading with select:, the tool becomes available for immediate use.",
981 InputPrototype: ToolSearchInput{},
982 Aliases: []string{"search_tools"},

Callers 1

ExecuteMethod · 0.85

Calls 6

truncateForMsgFunction · 0.85
SearchDeferredMethod · 0.80
GetDeferredToolsMethod · 0.80
SearchHintMethod · 0.65
DescriptionMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected