File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,8 +271,14 @@ export const specTypeSchemas: SchemaRecord = Object.freeze(_specTypeSchemas) as
271271/**
272272 * Type predicates for every MCP spec type, keyed by type name.
273273 *
274- * Returns `true` if the value structurally matches the named spec type. Each guard is a standalone
275- * function, so it can be passed directly as a callback.
274+ * Returns `true` if the value satisfies the schema's input type (`z.input<>`, before defaults and
275+ * transforms are applied), and narrows to that input type. For schemas with `.default()` or
276+ * `.preprocess()`, this may accept values that do not structurally match the named output type;
277+ * for example `isSpecType.CallToolResult({})` is `true` because `content` has a default. Use
278+ * `specTypeSchemas.X['~standard'].validate(value)` (or `.parse(value)`) when you need the
279+ * validated output value.
280+ *
281+ * Each guard is a standalone function, so it can be passed directly as a callback.
276282 *
277283 * @example
278284 * ```ts source="./specTypeSchema.examples.ts#isSpecType_basicUsage"
You can’t perform that action at this time.
0 commit comments