-
Notifications
You must be signed in to change notification settings - Fork 259
Description
Problem Overview
In the current OpenAI Apps SDK examples, the recommended pattern is to bundle JavaScript, host it on a CDN, and reference it statically from an MCP Resource.
However, Resource Templates (i.e., parametrized resource URIs) are not supported which limits the possibility to template the view based on the parameter for ChatGPT widgets.
What’s Missing
Currently, there is no way for a tool response to return a parametrized resource URI (template).
For example, a tool could ideally emit metadata like:
'openai/outputTemplate': 'ui://widget/pizza-list/{pizzaTopping}',
If the tool returns the topping "pepperoni"
, ChatGPT could then resolve and render the following Resource Template:
{
id: "pizza-list",
title: "Show Pizza List",
templateUri: "ui://widget/{pizzaTopping}", // Matching template URI
invoking: "Hand-tossing a list",
invoked: "Served a fresh list",
html: `<!-- RENDERING LOGIC GOES HERE -->`, // e.g. filter pizzas containing the topping
responseText: "Rendered a pizza list!"
}
This would allow tool responses to drive dynamic visualizations for e.g., filtering, searching, or contextual rendering without requiring full re-registration of resources or rebuilding bundles.
Current Behavior
- ChatGPT fetches and caches all resources (including templates) at connection time.
- Since templates are cached as static resources, the
{pizzaTopping}
placeholder is never resolved dynamically. - The UI can’t re-query or re-render based on runtime parameters.
Expected Behavior
- Resource Templates should be resolved on-demand, after the tool returns the URI and the parameter(s) to fill it.
- ChatGPT should then query the resource with the parameter substituted and render the appropriate visualization.
Why It Matters
Templated resources are a lightweight and elegant way to enable server-side rendered (SSR)-like widgets inside ChatGPT apps.
Supporting them would allow:
- Dynamic, data-driven widget views (search results, filtered lists, etc.)
- Major DX win, as it simplifies the stack to simply templating HTML and CSS.
Summary
Feature request: Support for dynamic
ResourceTemplate
resolution in ChatGPT widgets.
This would allow parameterized resource URIs to be resolved at runtime, enabling flexible, data-driven widget rendering and simplifying interactive app development.