@@ -331,27 +331,40 @@ When the Guest UI sends an `ui/initialize` request to the Host, the Host SHOULD
331331
332332``` typescript
333333interface HostContext {
334- toolInfo? : { // Metadata of the tool call that instantiated the App
335- id? : RequestId , // JSON-RPC id of the tools/call request
336- tool: Tool , // contains name, inputSchema, etc…
334+ /** Metadata of the tool call that instantiated the App */
335+ toolInfo? : {
336+ /** JSON-RPC id of the tools/call request */
337+ id? : RequestId ,
338+ /** Contains name, inputSchema, etc… */
339+ tool: Tool ,
337340 };
341+ /** Current color theme preference */
338342 theme? : " light" | " dark" | " system" ;
343+ /** How the UI is currently displayed */
339344 displayMode? : " inline" | " fullscreen" | " pip" | " carousel" ;
345+ /** Display modes the host supports */
340346 availableDisplayModes? : string [];
347+ /** Current and maximum dimensions available to the UI */
341348 viewport? : {
342349 width: number ;
343350 height: number ;
344351 maxHeight? : number ;
345352 maxWidth? : number ;
346353 };
347- locale? : string ; // BCP 47, e.g., "en-US"
348- timeZone? : string ; // IANA, e.g., "America/New_York"
354+ /** User's language/region preference (BCP 47, e.g., "en-US") */
355+ locale? : string ;
356+ /** User's timezone (IANA, e.g., "America/New_York") */
357+ timeZone? : string ;
358+ /** Host application identifier */
349359 userAgent? : string ;
360+ /** Platform type for responsive design */
350361 platform? : " web" | " desktop" | " mobile" ;
362+ /** Device capabilities such as touch */
351363 deviceCapabilities? : {
352364 touch? : boolean ;
353365 hover? : boolean ;
354366 }
367+ /** Mobile safe area boundaries in pixels */
355368 safeAreaInsets? : {
356369 top: number ;
357370 right: number ;
@@ -361,19 +374,6 @@ interface HostContext {
361374}
362375```
363376
364- ** Field Descriptions:**
365-
366- - ` theme ` : Current color theme preference
367- - ` displayMode ` : How the UI is currently displayed
368- - ` availableDisplayModes ` : Display modes the host supports
369- - ` viewport ` : Current and maximum dimensions available to the UI
370- - ` locale ` : User's language/region preference
371- - ` timeZone ` : User's timezone
372- - ` userAgent ` : Host application identifier
373- - ` platform ` : Platform type for responsive design
374- - ` deviceCapabilities ` : Device capabilities such as touch
375- - ` safeAreaInsets ` : Mobile safe area boundaries in pixels
376-
377377All fields are optional. Hosts SHOULD provide relevant context. Guest UIs SHOULD handle missing fields gracefully.
378378
379379Example:
0 commit comments