mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
122 lines • 3.7 kB
TypeScript
/**
* Tool Catalog Resource - Comprehensive tool metadata registry
* URI Pattern: adr://tools/catalog
*/
import { URLSearchParams } from 'url';
import { ResourceGenerationResult } from './index.js';
export interface ToolCatalogData {
summary: {
totalTools: number;
byCategory: Record<string, number>;
cemcpEnabled: number;
highTokenCost: number;
};
tools: Array<{
name: string;
description: string;
category: string;
complexity: string;
tokenCost: {
min: number;
max: number;
};
hasCEMCPDirective: boolean;
requiresAI: boolean;
relatedTools: string[];
keywords: string[];
}>;
timestamp: string;
}
/**
* Generate tool catalog resource with comprehensive tool metadata.
*
* Returns a complete catalog of all available MCP tools with:
* - Tool metadata (name, description, category, complexity)
* - Token cost estimates and CE-MCP availability
* - Related tools and keyword tags
* - Summary statistics by category
*
* **URI Pattern:** `adr://tools/catalog`
*
* **Query Parameters:**
* - `category`: Filter by tool category (optional)
* - `includeSchema`: Include full input schemas (default: false)
* - `lightweight`: Return minimal metadata only (default: false)
*
* @param params - URL path parameters (none for this resource)
* @param searchParams - URL query parameters for filtering
*
* @returns Promise resolving to resource generation result containing:
* - data: Complete tool catalog with metadata
* - contentType: "application/json"
* - lastModified: ISO timestamp of generation
* - cacheKey: Unique identifier "tool-catalog" or "tool-catalog:{category}"
* - ttl: Cache duration (300 seconds / 5 minutes)
* - etag: Entity tag for cache validation
*
* @throws {McpAdrError} When catalog generation fails
*
* @example
* ```typescript
* // Get full tool catalog
* const catalog = await generateToolCatalogResource(
* {},
* new URLSearchParams()
* );
*
* console.log(`Total tools: ${catalog.data.summary.totalTools}`);
* console.log(`CE-MCP enabled: ${catalog.data.summary.cemcpEnabled}`);
*
* // Filter by category
* const adrTools = await generateToolCatalogResource(
* {},
* new URLSearchParams('category=adr')
* );
*
* // Get lightweight catalog (minimal metadata)
* const lightweight = await generateToolCatalogResource(
* {},
* new URLSearchParams('lightweight=true')
* );
*
* // Expected output structure:
* {
* data: {
* summary: {
* totalTools: 60,
* byCategory: {
* analysis: 10,
* adr: 15,
* deployment: 8,
* ...
* },
* cemcpEnabled: 25,
* highTokenCost: 12
* },
* tools: [
* {
* name: "analyze_project_ecosystem",
* description: "Comprehensive project analysis...",
* category: "analysis",
* complexity: "complex",
* tokenCost: { min: 5000, max: 15000 },
* hasCEMCPDirective: true,
* requiresAI: true,
* relatedTools: ["get_architectural_context"],
* keywords: ["analysis", "ecosystem", "project"]
* },
* ...
* ],
* timestamp: "2025-12-16T04:30:00.000Z"
* },
* contentType: "application/json",
* cacheKey: "tool-catalog",
* ttl: 300
* }
* ```
*
* @since v2.2.0
* @see {@link TOOL_CATALOG} for the underlying tool registry
*/
export declare function generateToolCatalogResource(_params: Record<string, string>, searchParams: URLSearchParams): Promise<ResourceGenerationResult>;
//# sourceMappingURL=tool-catalog-resource.d.ts.map