Auto-sync: 2026-04-21 00:02
This commit is contained in:
18
wiki/concepts/Zod参数验证.md
Normal file
18
wiki/concepts/Zod参数验证.md
Normal 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服务器]]
|
||||
Reference in New Issue
Block a user