@@ -25,7 +25,7 @@ describe("Elicitation Integration Tests", () => {
2525 { elicitInput : mockElicitInput }
2626 ) ;
2727
28- describe ( "tools requiring confirmation" , ( ) => {
28+ describe ( "tools requiring confirmation by default " , ( ) => {
2929 it ( "should request confirmation for drop-database tool and proceed when confirmed" , async ( ) => {
3030 mockElicitInput . confirmYes ( ) ;
3131
@@ -37,19 +37,7 @@ describe("Elicitation Integration Tests", () => {
3737 expect ( mockElicitInput . mock ) . toHaveBeenCalledTimes ( 1 ) ;
3838 expect ( mockElicitInput . mock ) . toHaveBeenCalledWith ( {
3939 message : expect . stringContaining ( "You are about to drop the `test-db` database" ) ,
40- requestedSchema : {
41- type : "object" ,
42- properties : {
43- confirmation : {
44- type : "string" ,
45- title : "Would you like to confirm?" ,
46- description : "Would you like to confirm?" ,
47- enum : [ "Yes" , "No" ] ,
48- enumNames : [ "Yes, I confirm" , "No, I do not confirm" ] ,
49- } ,
50- } ,
51- required : [ "confirmation" ] ,
52- } ,
40+ requestedSchema : Elicitation . CONFIRMATION_SCHEMA ,
5341 } ) ;
5442
5543 // Should attempt to execute (will fail due to no connection, but confirms flow worked)
@@ -154,7 +142,7 @@ describe("Elicitation Integration Tests", () => {
154142 } ) ;
155143 } ) ;
156144
157- describe ( "tools not requiring confirmation" , ( ) => {
145+ describe ( "tools not requiring confirmation by default " , ( ) => {
158146 it ( "should not request confirmation for read operations" , async ( ) => {
159147 const result = await integration . mcpClient ( ) . callTool ( {
160148 name : "list-databases" ,
@@ -189,7 +177,7 @@ describe("Elicitation Integration Tests", () => {
189177 { getClientCapabilities : ( ) => ( { } ) }
190178 ) ;
191179
192- it ( "should proceed without confirmation for destructive tools when client lacks elicitation support" , async ( ) => {
180+ it ( "should proceed without confirmation for default confirmation-required tools when client lacks elicitation support" , async ( ) => {
193181 const result = await integration . mcpClient ( ) . callTool ( {
194182 name : "drop-database" ,
195183 arguments : { database : "test-db" } ,
@@ -217,7 +205,7 @@ describe("Elicitation Integration Tests", () => {
217205 { elicitInput : mockElicitInput }
218206 ) ;
219207
220- it ( "should respect custom confirmationRequiredTools configuration " , async ( ) => {
208+ it ( "should confirm with a generic message with custom configurations for other tools " , async ( ) => {
221209 mockElicitInput . confirmYes ( ) ;
222210
223211 await integration . mcpClient ( ) . callTool ( {
@@ -226,6 +214,12 @@ describe("Elicitation Integration Tests", () => {
226214 } ) ;
227215
228216 expect ( mockElicitInput . mock ) . toHaveBeenCalledTimes ( 1 ) ;
217+ expect ( mockElicitInput . mock ) . toHaveBeenCalledWith ( {
218+ message : expect . stringMatching (
219+ / Y o u a r e a b o u t t o e x e c u t e t h e ` l i s t - d a t a b a s e s ` t o o l w h i c h r e q u i r e s a d d i t i o n a l c o n f i r m a t i o n . W o u l d y o u l i k e t o p r o c e e d \? /
220+ ) ,
221+ requestedSchema : expect . objectContaining ( Elicitation . CONFIRMATION_SCHEMA ) ,
222+ } ) ;
229223 } ) ;
230224
231225 it ( "should not request confirmation when tool is removed from default confirmationRequiredTools" , async ( ) => {
0 commit comments