Runtime validators for every MCP spec type, keyed by type name.
Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for
example an extension's custom-method payload that embeds a CallToolResult, or a value read from
storage that should be a Tool.
Each entry implements the Standard Schema interface, so it composes with any
Standard-Schema-aware library. For a simple boolean check, use isSpecType instead.
Example
constresult = specTypeSchemas.CallToolResult['~standard'].validate(untrusted); if (result.issues === undefined) { // result.value is CallToolResult }
Runtime validators for every MCP spec type, keyed by type name.
Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for example an extension's custom-method payload that embeds a
CallToolResult, or a value read from storage that should be aTool.Each entry implements the Standard Schema interface, so it composes with any Standard-Schema-aware library. For a simple boolean check, use
isSpecTypeinstead.