Auto-sync: 2026-04-21 00:02

This commit is contained in:
2026-04-21 00:02:55 +08:00
parent 177469a1cd
commit cb7c11e14f
235 changed files with 16567 additions and 237 deletions

View File

@@ -0,0 +1,18 @@
---
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服务器]]