import { z } from "zod"; /** * Generic ToolRegistry — track registered tools by category. * * Each MCP server declares its own category const array (typed), * passes a category resolver, and uses this registry to decide * which tools to actually load on `server.tool()` based on env-driven * allowlist/denylist. */ export interface ToolEntry { name: string; description: string; category: TCategory; } export interface RegistryConfig { /** Allowlist categories (when set, only these load). */ enabledCategories?: string[] | null; /** Denylist categories (ignored when enabledCategories is set). */ disabledCategories?: string[] | null; /** Categories that are always enabled regardless of toggles. */ alwaysEnabled?: string[]; } export declare class ToolRegistry { private cfg; private tools; private alwaysEnabled; constructor(cfg?: RegistryConfig); register(name: string, description: string, category: TCategory): boolean; isEnabled(category: TCategory): boolean; list(): ToolEntry[]; search(query: string, category?: string, limit?: number): ToolEntry[]; summary(allCategories: readonly TCategory[]): { total: number; enabledCategories: TCategory[]; categoryBreakdown: { [k: string]: number; }; }; } /** * Factory for the `search-tools` meta-tool schema + handler. * Pass the registry and the categories array; receive a `{schema, handler}` pair * that can be registered with `server.tool(name, description, schema.shape, handler)`. */ export declare function createSearchToolsMetaTool(registry: ToolRegistry, categories: readonly TCategory[], hint?: string): { schema: z.ZodObject<{ query: z.ZodString; category: z.ZodOptional>; limit: z.ZodDefault>>; }, z.core.$strip>; handler: (params: z.infer>; limit: z.ZodDefault>>; }, z.core.$strip>>) => Promise<{ query: string; matchCount: number; summary: { total: number; enabledCategories: TCategory[]; categoryBreakdown: { [k: string]: number; }; }; matches: { name: string; description: string; category: TCategory; }[]; }>; }; /** * Parse a comma-separated env var into a lowercase string array, or null when unset. * Used for `_TOOLS` and `_DISABLE` env vars. */ export declare function parseEnvList(raw: string | undefined): string[] | null; //# sourceMappingURL=registry.d.ts.map