Skip to main content

Function: dereferenceSchema()

dereferenceSchema(schema, spec): Record<string, unknown> | undefined

Defined in: schema.ts:105

Recursively inlines every $ref in a schema (including refs nested inside properties, items, oneOf, anyOf, etc.), producing a self-contained schema safe to hand to an MCP client or LLM provider as a tool definition — provider tool schemas have no components section to resolve refs against.

Parameters

ParameterType
schemaRecord<string, unknown> | undefined
specOpenApiSpec

Returns

Record<string, unknown> | undefined