File tree Expand file tree Collapse file tree 1 file changed +23
-11
lines changed
Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -587,11 +587,17 @@ The tool execution handler is responsible for actually executing the logic of ea
587587
588588``` typescript
589589// Register weather tools
590- server .tool (
590+
591+ server .registerTool (
591592 " get_alerts" ,
592- " Get weather alerts for a state" ,
593593 {
594- state: z .string ().length (2 ).describe (" Two-letter state code (e.g. CA, NY)" ),
594+ description: " Get weather alerts for a state" ,
595+ inputSchema: {
596+ state: z
597+ .string ()
598+ .length (2 )
599+ .describe (" Two-letter state code (e.g. CA, NY)" ),
600+ },
595601 },
596602 async ({ state }) => {
597603 const stateCode = state .toUpperCase ();
@@ -635,16 +641,22 @@ server.tool(
635641 },
636642);
637643
638- server .tool (
644+ server .registerTool (
639645 " get_forecast" ,
640- " Get weather forecast for a location" ,
641646 {
642- latitude: z .number ().min (- 90 ).max (90 ).describe (" Latitude of the location" ),
643- longitude: z
644- .number ()
645- .min (- 180 )
646- .max (180 )
647- .describe (" Longitude of the location" ),
647+ description: " Get weather forecast for a location" ,
648+ inputSchema: {
649+ latitude: z
650+ .number ()
651+ .min (- 90 )
652+ .max (90 )
653+ .describe (" Latitude of the location" ),
654+ longitude: z
655+ .number ()
656+ .min (- 180 )
657+ .max (180 )
658+ .describe (" Longitude of the location" ),
659+ },
648660 },
649661 async ({ latitude , longitude }) => {
650662 // Get grid point data
You can’t perform that action at this time.
0 commit comments