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
Handlers and client/server methods take a single request argument
combining the session and params. This slightly simplifies the signature
for handlers, since there is no longer an often-ignored session
argument.
But more importantly, it opens the door to adding more information in
requests, such as auth info and HTTP request headers.
For #243.
**Differences from mcp-go**: We provide a full JSON Schema implementation for validating tool input schemas against incoming arguments. The `jsonschema.Schema` type provides exported features for all keywords in the JSON Schema draft2020-12 spec. Tool definers can use it to construct any schema they want. The `jsonschema.For[T]` function can infer a schema from a Go struct. These combined features eliminate the need for variadic arguments to construct tool schemas.
@@ -752,10 +748,10 @@ If a server author wants to support resource subscriptions, they must provide ha
752
748
```go
753
749
typeServerOptionsstruct {
754
750
...
755
-
// Function called when a client session subscribes to a resource.
756
-
SubscribeHandlerfunc(context.Context, ss *ServerSession, *SubscribeParams) error
757
-
// Function called when a client session unsubscribes from a resource.
758
-
UnsubscribeHandlerfunc(context.Context, ss *ServerSession, *UnsubscribeParams) error
751
+
// Function called when a client session subscribes to a resource.
Clients call the spec method `Complete` to request completions. If a server installs a `CompletionHandler`, it will be called when the client sends a completion request.
789
785
790
786
```go
791
-
// A CompletionHandler handles a call to completion/complete.
0 commit comments