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