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
* feat: add tool handler middleware capability
* docs: add WithRecovery middleware to the calculator mcp server example
* docs: add tool handler middleware section to the readme
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,7 @@ func main() {
122
122
"1.0.0",
123
123
server.WithResourceCapabilities(true, true),
124
124
server.WithLogging(),
125
+
server.WithRecovery(),
125
126
)
126
127
127
128
// Add a calculator tool
@@ -522,6 +523,12 @@ initialization.
522
523
Add the `Hooks` to the server at the time of creation using the
523
524
`server.WithHooks` option.
524
525
526
+
### Tool Handler Middleware
527
+
528
+
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.
529
+
530
+
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