diff --git a/mcp/logging.go b/mcp/logging.go index e8d0cd73..c4dd1b55 100644 --- a/mcp/logging.go +++ b/mcp/logging.go @@ -151,7 +151,7 @@ func NewLoggingHandler(ss *ServerSession, opts *LoggingHandlerOptions) *LoggingH // Enabled implements [slog.Handler.Enabled] by comparing level to the [ServerSession]'s level. func (h *LoggingHandler) Enabled(ctx context.Context, level slog.Level) bool { - // This is also checked in ServerSession.LoggingMessage, so checking it here + // This is also checked in ServerSession.Log, so checking it here // is just an optimization that skips building the JSON. if mcpLevel, ok := logLevelFromContext(ctx); ok { return mcpLevel != "" && level >= mcpLevelToSlog(mcpLevel) @@ -177,7 +177,7 @@ func (h *LoggingHandler) WithGroup(name string) slog.Handler { } // Handle implements [slog.Handler.Handle] by writing the Record to a JSONHandler, -// then calling [ServerSession.LoggingMessage] with the result. +// then calling [ServerSession.Log] with the result. func (h *LoggingHandler) Handle(ctx context.Context, r slog.Record) error { err := h.handle(ctx, r) // TODO(jba): find a way to surface the error. diff --git a/mcp/protocol.go b/mcp/protocol.go index d5ef5400..ff6fb516 100644 --- a/mcp/protocol.go +++ b/mcp/protocol.go @@ -59,7 +59,7 @@ func annotateResultType(res Result) { // InputRequest is a type for parameters that a server can include in the response // to request input from client (SEP-2322). Implementations are [*ElicitParams], -// [*CreateMessageParams], and [*ListRootsParams]. +// [*CreateMessageParams], [*CreateMessageWithToolsParams], and [*ListRootsParams]. type InputRequest interface{ isInputRequest() } // InputRequestMap maps server-assigned request IDs to [InputRequest] values. @@ -143,7 +143,7 @@ func (m *InputRequestMap) UnmarshalJSON(data []byte) error { // InputResponse is a type for results that a client sends back when fulfilling // a server input request (SEP-2322). Implementations are [*ElicitResult], -// [*CreateMessageResult], and [*ListRootsResult]. +// [*CreateMessageResult], [*CreateMessageWithToolsResult], and [*ListRootsResult]. type InputResponse interface{ isInputResponse() } // InputResponseMap maps request IDs (from [InputRequestMap]) to [InputResponse] diff --git a/mcp/streamable.go b/mcp/streamable.go index 9f8f2234..6e28051b 100644 --- a/mcp/streamable.go +++ b/mcp/streamable.go @@ -2808,9 +2808,9 @@ func (c *streamableClientConn) checkResponse(ctx context.Context, requestSummary } // processStream reads from a single response body, sending events to the -// incoming channel. It returns the ID of the last processed event and a flag -// indicating if the connection was closed by the client. If resp is nil, it -// returns "", false. +// incoming channel. It returns the ID of the last processed event, the +// reconnect delay requested by the server (if any), and a flag indicating +// whether the connection was closed by the client. resp must be non-nil. func (c *streamableClientConn) processStream(ctx context.Context, requestSummary string, resp *http.Response, forCall *jsonrpc.Request) (lastEventID string, reconnectDelay time.Duration, clientClosed bool) { defer func() { // Drain any remaining unprocessed body. This allows the connection to be re-used after closing.