v2 backwards compat: specTypeSchema exported - synchronous StandardSchemaV1 (#2047)

This commit is contained in:
Konstantin Konstantinov 2026-05-15 16:51:48 +03:00 • committed by GitHub
commit 22595b9685
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,4 +3,4 @@
'@modelcontextprotocol/server': minor
---
Export `isSpecType` and `specTypeSchemas` records for runtime validation of any MCP spec type by name. `isSpecType.ContentBlock(value)` is a type predicate; `specTypeSchemas.ContentBlock` is a `StandardSchemaV1<ContentBlock>` validator. Guards are standalone functions, so `arr.filter(isSpecType.ContentBlock)` works. Also export the `SpecTypeName` and `SpecTypes` types.
Export `isSpecType` and `specTypeSchemas` records for runtime validation of any MCP spec type by name. `isSpecType.ContentBlock(value)` is a type predicate; `specTypeSchemas.ContentBlock` is a `StandardSchemaV1Sync<ContentBlock>` validator — `validate()` returns the result synchronously. Guards are standalone functions, so `arr.filter(isSpecType.ContentBlock)` works. Also export the `SpecTypeName`, `SpecTypes`, and `StandardSchemaV1Sync` types.