File tree Expand file tree Collapse file tree
packages/server/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -472,10 +472,10 @@ export class Server extends Protocol<ServerContext> {
472472 params : CreateMessageRequest [ 'params' ] ,
473473 options ?: RequestOptions
474474 ) : Promise < CreateMessageResult | CreateMessageResultWithTools > {
475- if ( ! this . _clientCapabilities ?. sampling ) {
476- throw new SdkError ( SdkErrorCode . CapabilityNotSupported , 'Client does not support sampling capability.' ) ;
477- }
478- if ( ( params . tools || params . toolChoice ) && ! this . _clientCapabilities . sampling . tools ) {
475+ // Base ` sampling` capability is checked via assertCapabilityForMethod() (gated on
476+ // enforceStrictCapabilities, which defaults to false). Only the ` sampling.tools`
477+ // sub-capability is enforced here unconditionally, matching the v1 createMessage body.
478+ if ( ( params . tools || params . toolChoice ) && ! this . _clientCapabilities ? .sampling ? .tools ) {
479479 throw new SdkError ( SdkErrorCode . CapabilityNotSupported , 'Client does not support sampling tools capability.' ) ;
480480 }
481481
You can’t perform that action at this time.
0 commit comments