Skip to main content

Function: toToolSchema()

toToolSchema(value): unknown

Defined in: http-server-mcp-openapi/src/fullSchema.ts:145

Turns an already-dereferenced OpenAPI schema into the JSON Schema a tool argument carries, keeping every constraint it declares — enum, format, pattern, minimum, default, nested properties and required, oneOf — and changing only what JSON Schema cannot express: allOf is merged, nullable becomes a 'null' type, and OpenAPI-only keywords and x- extensions are dropped. Descriptions are kept verbatim.

Parameters​

ParameterType
valueunknown

Returns​

unknown