File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,11 +107,15 @@ function normalizeAppToolMeta(
107107 meta : McpUiAppToolConfig [ "_meta" ] ,
108108) : Record < string , unknown > {
109109 const out : Record < string , unknown > = { ...meta } ;
110- // Promote nested form to flat key for hosts that only check the legacy key.
111- const nested = ( meta as { ui ?: McpUiToolMeta } ) . ui ;
112- if ( nested ?. resourceUri && ! ( RESOURCE_URI_META_KEY in out ) ) {
113- out [ RESOURCE_URI_META_KEY ] = nested . resourceUri ;
110+ const ui = { ...( ( meta as { ui ?: McpUiToolMeta } ) . ui ?? { } ) } as McpUiToolMeta ;
111+ const flat = out [ RESOURCE_URI_META_KEY ] ;
112+ // Sync both directions so hosts checking either format see the resource URI.
113+ if ( ui . resourceUri && ! ( RESOURCE_URI_META_KEY in out ) ) {
114+ out [ RESOURCE_URI_META_KEY ] = ui . resourceUri ;
115+ } else if ( typeof flat === "string" && ! ui . resourceUri ) {
116+ ui . resourceUri = flat ;
114117 }
118+ out . ui = ui ;
115119 return out ;
116120}
117121
You can’t perform that action at this time.
0 commit comments