Remove NewServerPrompt. Schema inference is irrelevant for prompts. All arguments are strings. So using a struct is not as valuable as with tools. The only advantage is catching misspellings at compile time. It's not worth it. Change-Id: I45aaa5d55c8940cc9e32dc277bd543f79d932519 Reviewed-on: https://go-review.googlesource.com/c/tools/+/682797 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
18 lines
488 B
Go
18 lines
488 B
Go
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
|
|
// Use of this source code is governed by an MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package mcp
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// A PromptHandler handles a call to prompts/get.
|
|
type PromptHandler func(context.Context, *ServerSession, *GetPromptParams) (*GetPromptResult, error)
|
|
|
|
// A Prompt is a prompt definition bound to a prompt handler.
|
|
type ServerPrompt struct {
|
|
Prompt *Prompt
|
|
Handler PromptHandler
|
|
}
|