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 @@ -489,10 +489,10 @@ export class Server extends Protocol<ServerContext> {
489489 params : CreateMessageRequest [ 'params' ] ,
490490 options ?: RequestOptions
491491 ) : Promise < CreateMessageResult | CreateMessageResultWithTools > {
492- if ( ! this . _clientCapabilities ?. sampling ) {
493- throw new SdkError ( SdkErrorCode . CapabilityNotSupported , 'Client does not support sampling capability.' ) ;
494- }
495- if ( ( params . tools || params . toolChoice ) && ! this . _clientCapabilities . sampling . tools ) {
492+ // Base ` sampling` capability is checked via assertCapabilityForMethod() (gated on
493+ // enforceStrictCapabilities, which defaults to false). Only the ` sampling.tools`
494+ // sub-capability is enforced here unconditionally, matching the v1 createMessage body.
495+ if ( ( params . tools || params . toolChoice ) && ! this . _clientCapabilities ? .sampling ? .tools ) {
496496 throw new SdkError ( SdkErrorCode . CapabilityNotSupported , 'Client does not support sampling tools capability.' ) ;
497497 }
498498
You can’t perform that action at this time.
0 commit comments