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

Function TestToolSearchPrefixSyntax

test/tools_parity_test.go:925–948  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

923}
924
925func TestToolSearchPrefixSyntax(t *testing.T) {
926 registry := coretools.NewToolRegistry(coretools.NewToolSearchTool())
927 registry.Register(&deferredTestTool{BaseTool: coretools.BaseTool{Spec: coretools.ToolSpec{
928 Name: "mcp_alpha",
929 Description: "Alpha remote tool",
930 InputPrototype: map[string]any{},
931 ShouldDefer: true,
932 ReadOnly: coretools.BoolPtr(true),
933 }}})
934 registry.Register(&deferredTestTool{BaseTool: coretools.BaseTool{Spec: coretools.ToolSpec{
935 Name: "notebook_beta",
936 Description: "Beta notebook tool",
937 InputPrototype: map[string]any{},
938 ShouldDefer: true,
939 ReadOnly: coretools.BoolPtr(true),
940 }}})
941
942 result := registry.Execute(context.Background(), coretools.ToolCall{
943 ID: "search-1", Name: "tool_search", Input: map[string]any{"query": "+mcp"},
944 }, coretools.ExecutionContext{"_registry": registry})
945 if result.IsError || !strings.Contains(result.Content, "mcp_alpha") || strings.Contains(result.Content, "notebook_beta") {
946 t.Fatalf("unexpected prefix search result: error=%v content=%q", result.IsError, result.Content)
947 }
948}
949
950func TestToolSearchSelectArgumentsUsePythonJSONDumpsFormatting(t *testing.T) {
951 registry := coretools.NewToolRegistry(coretools.NewToolSearchTool())

Callers

nothing calls this directly

Calls 2

RegisterMethod · 0.95
ExecuteMethod · 0.95

Tested by

no test coverage detected