在本講座中,我們說明如何透過
JSON Schema 在 MCP 與 ChatGPT Apps 中描述工具:
inputSchema 的結構、為什麼它是模型「提示」的一部分、如何正確撰寫
description、何時使用
enum 與限制(
minItems、
format)。接著用 TypeScript 搭配
Zod +
zod-to-json-schema 建立「single source of truth」,討論
optional 欄位的問題,並說明
_meta/annotations(例如
readOnlyHint、
destructiveHint、
openai/outputTemplate)在 UX 與安全上的角色。