File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -56,13 +56,12 @@ export class CodegenServer {
5656 }
5757
5858 // server elicitation request
59- // Placeholder for future elicitInput when SDK exposes it
60- // public elicitInput(
61- // params: ElicitRequest["params"],
62- // options?: RequestOptions
63- // ): Promise<ElicitResult> {
64- // return this._mcp.server.elicitInput(params, options);
65- // }
59+ public elicitInput (
60+ params : ElicitRequest [ "params" ] ,
61+ options ?: RequestOptions
62+ ) : Promise < ElicitResult > {
63+ return this . _mcp . server . elicitInput ( params , options ) ;
64+ }
6665
6766 public static getInstance ( ) : CodegenServer {
6867 if ( ! CodegenServer . _instance ) {
Original file line number Diff line number Diff line change @@ -138,8 +138,25 @@ export class ToolsService {
138138 const exampleSpecs = await utils . getExampleJsonContent ( exampleSpecsPath ) ;
139139 for ( const { name, content} of exampleSpecs ) {
140140 const example = await utils . flattenJsonObject ( content [ 'parameters' ] ) ;
141- // Interactive elicitInput flow is disabled pending SDK support.
142- // Once available, re-enable to allow user review of each example.
141+ try {
142+ const response = await this . _server ! . elicitInput ( {
143+ "message" : `Please review example data for ${ name } : ${ example . map ( ( { key : k , value :v } ) => ` \n${ k } : ${ v } ` ) } ` ,
144+ "requestedSchema" : {
145+ "type" : "object" ,
146+ "properties" : {
147+ "skipAll" : {
148+ "type" : "boolean" ,
149+ "description" : "If true, skip the review of all examples and proceed to the next step."
150+ }
151+ } ,
152+ }
153+ } ) ;
154+ if ( response . content && response . content [ 'skipAll' ] === true ) {
155+ break ;
156+ }
157+ } catch ( error ) {
158+ console . error ( `Error eliciting input for example ${ name } :` , error ) ;
159+ }
143160 }
144161 return [ exampleSpecsPath , examplePath ] ;
145162 }
You can’t perform that action at this time.
0 commit comments