MCP TypeScript SDK (V2)
    Preparing search index...
    • Gets the Zod schema for a given request method. The return type is a ZodType that parses to RequestTypeMap[M], allowing callers to use schema.parse() without needing additional type assertions.

      Note: The internal cast is necessary because TypeScript can't correlate the Record-based schema lookup with the MethodToTypeMap-based RequestTypeMap when M is a generic type parameter. Both compute to the same type at instantiation, but TypeScript can't prove this statically.

      Type Parameters

      Parameters

      • method: M

      Returns ZodType<RequestTypeMap[M]>