import { OpenAPIV3 } from "openapi-types"; import { Tool } from "@modelcontextprotocol/sdk/types.js"; /** * Extended Tool interface with metadata for filtering * This extends the standard MCP Tool interface with additional properties * that are computed during tool creation to optimize filtering operations */ export interface ExtendedTool extends Tool { /** OpenAPI tags associated with this tool's operation */ tags?: string[]; /** HTTP method for this tool (GET, POST, etc.) */ httpMethod?: string; /** Primary resource name extracted from the path */ resourceName?: string; /** Original OpenAPI path before toolId conversion */ originalPath?: string; } /** * Spec input method type */ export type SpecInputMethod = "url" | "file" | "stdin" | "inline"; /** * Class to load and parse OpenAPI specifications */ export declare class OpenAPISpecLoader { /** * Disable name optimization */ private disableAbbreviation; private logger; constructor(config?: { disableAbbreviation?: boolean; verbose?: boolean; }); /** * Load an OpenAPI specification from various sources */ loadOpenAPISpec(specPathOrUrl: string, inputMethod?: SpecInputMethod, inlineContent?: string): Promise; /** * Load spec content from URL */ private loadFromUrl; /** * Load spec content from local file */ private loadFromFile; /** * Load spec content from standard input */ private loadFromStdin; /** * Parse spec content as JSON or YAML */ private parseSpecContent; /** * Inline `$ref` schemas from components and drop recursive cycles */ private inlineSchema; /** * Determine the appropriate JSON Schema type for a parameter * @param paramSchema The OpenAPI schema object after inlining * @param paramName The name of the parameter (for logging purposes) * @returns The determined type string, or undefined if the type should be omitted */ private determineParameterType; /** * Extract the primary resource name from an OpenAPI path * Examples: * - "/users" -> "users" * - "/users/{id}" -> "users" * - "/api/v1/users/{id}/posts" -> "posts" * - "/health" -> "health" */ private extractResourceName; /** * Parse an OpenAPI specification into a map of tools */ parseOpenAPISpec(spec: OpenAPIV3.Document): Map; private generateShortHash; private splitCombined; private splitCombinedWithoutNumbers; private _initialSanitizeAndValidate; private _performSemanticAbbreviation; private _applyVowelRemovalIfOverLength; private _truncateAndApplyHashIfNeeded; private _finalizeNameFormatting; abbreviateOperationId(originalId: string, maxLength?: number): string; }