You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discuss the SDK on [Discord](https://discord.gg/RqSS2NQVsY)
18
+
15
19
</div>
16
20
17
21
```go
@@ -122,6 +126,7 @@ func main() {
122
126
"1.0.0",
123
127
server.WithResourceCapabilities(true, true),
124
128
server.WithLogging(),
129
+
server.WithRecovery(),
125
130
)
126
131
127
132
// Add a calculator tool
@@ -522,6 +527,12 @@ initialization.
522
527
Add the `Hooks` to the server at the time of creation using the
523
528
`server.WithHooks` option.
524
529
530
+
### Tool Handler Middleware
531
+
532
+
Add middleware to tool call handlers using the `server.WithToolHandlerMiddleware` option. Middlewares can be registered on server creation and are applied on every tool call.
533
+
534
+
A recovery middleware option is available to recover from panics in a tool call and can be added to the server with the `server.WithRecovery` option.
0 commit comments