/** * MCP Tool Registry * * Provides: * - createToolRegistry: Builds one validated source of truth for tool metadata. * - listRegisteredTools: Produces MCP list-tools output with complete annotations. * - getRegisteredTool: Resolves the sole handler and policy mapping for a tool. */ import type { PolicyRiskLevel } from "../core/policy/types.js"; /** MCP annotations used by Codex to reason about side effects. */ export interface ToolAnnotations { title: string; readOnlyHint: boolean; destructiveHint: boolean; idempotentHint: boolean; openWorldHint: boolean; } /** Minimal tool declaration accepted by the MCP SDK. */ export interface ToolDefinition { name: string; description: string; inputSchema: Record; annotations?: Partial; } /** Context supplied by the MCP request adapter to registered handlers. */ export interface ToolExecutionContext { dispatch: (name: string, args: Record) => Promise; } /** Complete internal contract for one listed and callable tool. */ export interface RegisteredTool extends ToolDefinition { annotations: ToolAnnotations; policyAction: string; riskLevel: PolicyRiskLevel; handler: (args: Record, context: ToolExecutionContext) => Promise; } /** * Builds and validates the complete MCP registry. * * @param definitions - Public tool declarations. * @returns Name-keyed registry with one fixed-name handler per declaration. */ export declare function createToolRegistry(definitions: readonly ToolDefinition[]): ReadonlyMap>; /** Returns one registered tool or throws a stable unknown-tool error. */ export declare function getRegisteredTool(registry: ReadonlyMap>, name: string): RegisteredTool; /** Produces MCP list-tools output without internal handler/policy fields. */ export declare function listRegisteredTools(registry: ReadonlyMap>): ToolDefinition[]; //# sourceMappingURL=tool-registry.d.ts.map