File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ export const cliOptions = {
157157 describe : 'Whether to enable vision tools' ,
158158 hidden : true ,
159159 } ,
160+ experimentalStructuredContent : {
161+ type : 'boolean' ,
162+ describe : 'Whether to output structured formatted content.' ,
163+ hidden : true ,
164+ } ,
160165 experimentalIncludeAllPages : {
161166 type : 'boolean' ,
162167 describe :
File renamed without changes.
Original file line number Diff line number Diff line change @@ -153,10 +153,22 @@ function registerTool(tool: ToolDefinition): void {
153153 response ,
154154 context ,
155155 ) ;
156- const { content} = await response . handle ( tool . name , context ) ;
157- return {
156+ const { content, structuredContent} = await response . handle (
157+ tool . name ,
158+ context ,
159+ ) ;
160+ const result : CallToolResult & {
161+ structuredContent ?: Record < string , unknown > ;
162+ } = {
158163 content,
159164 } ;
165+ if ( args . experimentalStructuredContent ) {
166+ result . structuredContent = structuredContent as Record <
167+ string ,
168+ unknown
169+ > ;
170+ }
171+ return result ;
160172 } catch ( err ) {
161173 logger ( `${ tool . name } error:` , err , err ?. stack ) ;
162174 let errorText = err && 'message' in err ? err . message : String ( err ) ;
You can’t perform that action at this time.
0 commit comments