get-api-catalog
Retrieve the API catalog containing metadata for all OpenAPI specifications, operations, and schemas to enable AI-powered development tools to understand and work with your APIs.
Instructions
Get the API catalog, the catalog contains metadata about all openapi specifications, their operations and schemas
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/McpService.ts:73-90 (registration)Registration of the MCP tool 'get-api-catalog' including its description and handler function. The handler fetches the API catalog from the specExplorer and serializes it to YAML text for response.
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/core/SpecService.ts:242-244 (helper)Implementation of the getApiCatalog method in FileSystemSpecService (implements ISpecExplorer), which returns the pre-built catalog of discovered API specifications.
async getApiCatalog(): Promise<SpecCatalogEntry[]> { return this.catalog; } - Type signature of getApiCatalog method in ISpecExplorer interface, returning Promise<SpecCatalogEntry[]>.
/** * List all specifications in the catalog */ getApiCatalog(): Promise<SpecCatalogEntry[]>; - Type definition for SpecCatalogEntry, the core data structure of the API catalog 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[]; }