get-api-catalog
Retrieve the API catalog to access metadata for all OpenAPI specifications, operations, and schemas, enabling easier integration and understanding within development tools.
Instructions
Get the API catalog, the catalog contains metadata about all openapi specifications, their operations and schemas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/McpService.ts:73-90 (registration)Registration of the 'get-api-catalog' MCP tool, including the inline handler that fetches the catalog from specExplorer and returns it as YAML string.server.tool( "get-api-catalog", "Get the API catalog, the catalog contains metadata about all openapi specifications, their operations and schemas", async () => { try { this.logger.debug('Getting API catalog'); const catalog = await this.specExplorer.getApiCatalog(); return { content: [ { type: "text", text: stringify({ catalog }, { indent: 2 }) }, ], }; } catch (error) { this.logger.error('Failed to get API catalog', { error }); throw error; } } );
- src/McpService.ts:76-89 (handler)Inline handler function for the tool that calls specExplorer.getApiCatalog() and formats the response.async () => { try { this.logger.debug('Getting API catalog'); const catalog = await this.specExplorer.getApiCatalog(); return { content: [ { type: "text", text: stringify({ catalog }, { indent: 2 }) }, ], }; } catch (error) { this.logger.error('Failed to get API catalog', { error }); throw error; } }
- src/core/SpecService.ts:242-244 (helper)Implementation of getApiCatalog() in SpecService (FileSystemSpecService) which returns the cached catalog of API specifications.async getApiCatalog(): Promise<SpecCatalogEntry[]> { return this.catalog; }
- Type definition for SpecCatalogEntry, the structure returned by getApiCatalog().export interface SpecCatalogEntry { /** URI identifying the specification */ uri: SpecUri; /** Optional description of the specification */ description?: string; /** List of operations in the specification */ operations: SpecOperationEntry[]; /** List of schemas in the specification */ schemas: SpecSchemaEntry[]; }
- Interface definition of getApiCatalog method in ISpecExplorer.getApiCatalog(): Promise<SpecCatalogEntry[]>;