internal/mcp: rename NewXXX->NewServerXXX
The NewTool and NewPrompt constructors were unidiomatic, because they returned a ServerTool and ServerPrompt, respectively, rather than a Tool and Prompt. Rename to be consistent with the constructed object name. Change-Id: Ife3f16f783368401f792660c4272e1bb5ae61638 Reviewed-on: https://go-review.googlesource.com/c/tools/+/682375 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
parent
d2f2f87bbe
commit
9453d6bf6c
1 changed files with 76 additions and 74 deletions
|
|
@ -22,9 +22,9 @@ func TestList(t *testing.T) {
|
|||
defer serverSession.Close()
|
||||
|
||||
t.Run("tools", func(t *testing.T) {
|
||||
toolA := mcp.NewTool("apple", "apple tool", SayHi)
|
||||
toolB := mcp.NewTool("banana", "banana tool", SayHi)
|
||||
toolC := mcp.NewTool("cherry", "cherry tool", SayHi)
|
||||
toolA := mcp.NewServerTool("apple", "apple tool", SayHi)
|
||||
toolB := mcp.NewServerTool("banana", "banana tool", SayHi)
|
||||
toolC := mcp.NewServerTool("cherry", "cherry tool", SayHi)
|
||||
tools := []*mcp.ServerTool{toolA, toolB, toolC}
|
||||
wantTools := []*mcp.Tool{toolA.Tool, toolB.Tool, toolC.Tool}
|
||||
server.AddTools(tools...)
|
||||
|
|
@ -88,9 +88,9 @@ func TestList(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("prompts", func(t *testing.T) {
|
||||
promptA := mcp.NewPrompt("apple", "apple prompt", testPromptHandler[struct{}])
|
||||
promptB := mcp.NewPrompt("banana", "banana prompt", testPromptHandler[struct{}])
|
||||
promptC := mcp.NewPrompt("cherry", "cherry prompt", testPromptHandler[struct{}])
|
||||
promptA := mcp.NewServerPrompt("apple", "apple prompt", testPromptHandler[struct{}])
|
||||
promptB := mcp.NewServerPrompt("banana", "banana prompt", testPromptHandler[struct{}])
|
||||
promptC := mcp.NewServerPrompt("cherry", "cherry prompt", testPromptHandler[struct{}])
|
||||
wantPrompts := []*mcp.Prompt{promptA.Prompt, promptB.Prompt, promptC.Prompt}
|
||||
prompts := []*mcp.ServerPrompt{promptA, promptB, promptC}
|
||||
server.AddPrompts(prompts...)
|
||||
|
|
|
|||
Loading…
Reference in a new issue