The _meta field includes tasksById for hidden metadata and uiTemplate referencing the registered HTML. When ChatGPT receives this response, it will render the template with the structured content. The window.openai.toolOutput object in the component can then read the board data and display it.
In this section we will build a simple Task Tracker app that demonstrates the core concepts of the Apps SDK. The app will let a user create tasks and organise them into categories. We choose this example because it is generic, easy to extend and showcases structured content, metadata, custom UI and tool calls.
Set up the MCP Server
First install the TypeScript SDK and scaffolding tool:
This command scaffolds a project with a server, a React frontend and build scripts. The server uses Express and the @openai/apps library. Run npm run dev to start the development server; the project includes an MCP Inspector that opens in your browser and simulates ChatGPT calling your app.
Define the Tool
Open src/server.ts and define a tool called createTasks. The tool accepts an array of tasks and returns structured content grouping them by category. It also provides a summary in the content field.
Next open src/frontend/App.tsx. This React component will read the structuredContent and display categories and tasks. It will also allow users to mark tasks as complete and persist that state using setWidgetState.
This component uses window.openai.toolOutput to access the structuredContent and _meta fields. It stores completion state in widgetState so that checking a box persists even when the user continues the conversation. On subsequent tool calls, the component can fetch new tasks or update existing ones. This demonstrates how to combine model reasoning with client‑side interactions.
Testing and Iterating
Run npm run dev again and open the MCP Inspector. In the prompt area, type:
@task‑tracker create a list of tasks: buy milk in shopping, finish report in work, call mom in personal
The inspector will show the structured content and render the task list UI. You can check tasks off; the state persists across turns. You can then ask ChatGPT: “Remind me of my tasks later.” Because the model retains context, it can call the tool again, display the UI and summarise your progress.
How Users Discover and Use Apps
Named Mention and In‑Conversation Discovery
ChatGPT surfaces apps when it believes they can assist the user. There are two primary discovery modes. Named mention occurs when the user explicitly mentions the app name at the beginning of a prompt; in this case, the app will be surfaced automatically[9]. For instance, “@Spotify create a workout playlist” immediately invokes the Spotify integration. The user must place the app name at the start; otherwise the assistant may treat it as part of the conversation.
In‑conversation discovery happens when the model infers that an app could help based on context. The documentation explains that the model evaluates the conversation context, prior tool results and the user’s linked apps to determine which app might be relevant[9]. For example, if you are discussing travel plans, ChatGPT might suggest the Expedia app to book flights. The algorithm uses metadata like tool descriptions and keywords to match the conversation with potential actions[10]. Developers can improve discoverability by writing action‑oriented descriptions and clear UI component names.
Directory and Launcher
OpenAI plans to release an app directory where users can browse and discover new apps[10]. Each listing will include the app name, description, supported prompts and any onboarding instructions. Users can also access the launcher via the “+” button in chat; this shows a menu of available apps based on context. These entry points will help less technical users find and enable apps without memorising names.
指引強調,應用程式應只收集其功能所必需的數據,且不得要求或存儲如健康記錄或政府 ID 等敏感數據[12]。發送給模型的結構化內容不應包含秘密;隱藏的元數據不應存儲用戶令牌或私人細節。開發者必須為 OAuth 過程中獲得的任何令牌實施強加密和安全存儲。伺服器應保持用戶會話之間的嚴格界限;一位用戶的數據絕不應洩漏到另一位用戶的上下文中。
能夠在不切換上下文的情況下使用應用程式,可能會重塑人們與服務的互動方式。ChatGPT 不僅僅是聊天機器人,而是一個意圖的通用操作系統。正如 Casey Newton 所觀察的那樣,這讓我們從啟動獨立應用程式轉變為僅僅表達我們的需求[16]。一些分析人士將這一轉變比作 App Store 或瀏覽器的推出:一個聚合功能與競爭的單一平台。