File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ func main() {
5858}
5959
6060func helloHandler (ctx context .Context , request mcp .CallToolRequest ) (*mcp .CallToolResult , error ) {
61- name , ok := request.GetArguments ()[ " name" ].( string )
62- if !ok {
63- return nil , errors. New ( " name must be a string " )
61+ name , err := request.RequireString ( " name" )
62+ if err != nil {
63+ return mcp. NewToolResultError (err. Error ()), nil
6464 }
6565
6666 return mcp.NewToolResultText (fmt.Sprintf (" Hello, %s !" , name)), nil
@@ -94,11 +94,15 @@ MCP Go handles all the complex protocol details and server management, so you ca
9494 - [ Prompts] ( #prompts )
9595- [ Examples] ( #examples )
9696- [ Extras] ( #extras )
97+ - [ Transports] ( #transports )
9798 - [ Session Management] ( #session-management )
99+ - [ Basic Session Handling] ( #basic-session-handling )
100+ - [ Per-Session Tools] ( #per-session-tools )
101+ - [ Tool Filtering] ( #tool-filtering )
102+ - [ Working with Context] ( #working-with-context )
98103 - [ Request Hooks] ( #request-hooks )
99104 - [ Tool Handler Middleware] ( #tool-handler-middleware )
100105 - [ Regenerating Server Code] ( #regenerating-server-code )
101- - [ Contributing] ( /CONTRIBUTING.md )
102106
103107## Installation
104108
You can’t perform that action at this time.
0 commit comments