406 B
406 B
title, type, tags, date
| title | type | tags | date | |||
|---|---|---|---|---|---|---|
| Zod参数验证 | concept |
|
2026-04-20 |
Definition
在 TypeScript MCP Server 中使用 Zod 为工具参数提供运行时类型验证与约束。
Key Points
- 在工具边界做验证
- 为枚举、默认值、范围限制提供清晰 schema
- 避免把未验证参数传入外部 API