README.md: add description to tool input (#38)
This commit is contained in:
parent
92859ef391
commit
376d9499d6
2 changed files with 10 additions and 2 deletions
|
|
@ -102,7 +102,11 @@ func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParam
|
|||
func main() {
|
||||
// Create a server with a single tool.
|
||||
server := mcp.NewServer("greeter", "v1.0.0", nil)
|
||||
server.AddTools(mcp.NewServerTool("greet", "say hi", SayHi))
|
||||
server.AddTools(
|
||||
mcp.NewServerTool("greet", "say hi", SayHi, mcp.Input(
|
||||
mcp.Property("name", mcp.Description("the name of the person to greet")),
|
||||
)),
|
||||
)
|
||||
// Run the server over stdin/stdout, until the client disconnects
|
||||
if err := server.Run(context.Background(), mcp.NewStdioTransport()); err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParam
|
|||
func main() {
|
||||
// Create a server with a single tool.
|
||||
server := mcp.NewServer("greeter", "v1.0.0", nil)
|
||||
server.AddTools(mcp.NewServerTool("greet", "say hi", SayHi))
|
||||
server.AddTools(
|
||||
mcp.NewServerTool("greet", "say hi", SayHi, mcp.Input(
|
||||
mcp.Property("name", mcp.Description("the name of the person to greet")),
|
||||
)),
|
||||
)
|
||||
// Run the server over stdin/stdout, until the client disconnects
|
||||
if err := server.Run(context.Background(), mcp.NewStdioTransport()); err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue