diff --git a/src/api.ts b/src/api.ts index 050ed86..d2a7d15 100644 --- a/src/api.ts +++ b/src/api.ts @@ -27,7 +27,7 @@ export interface GetToolsOptions { } function isOpenApiDocument(spec: string | OpenAPIV3.Document): spec is OpenAPIV3.Document { - return typeof spec === 'object' && 'openapi' in spec; + return typeof spec === 'object' && spec !== null && 'openapi' in spec; } /**