import type { McpContext } from "./lib/context.js"; import type { ToolDefinition, ToolScope } from "./lib/types.js"; /** * The single source of truth for MisarMail's MCP surface. * * Both transports — the stdio binary (`@misarmail/mcp`) and the Streamable HTTP * route at `api.misar.io/mail/mcp` — build their catalogue from this array. * Before consolidation the two shipped disjoint tool sets under different naming * conventions (`send_email` vs `email.send`), so a fix in one never reached the * other and directories scanned whichever happened to be reachable. */ export declare const ALL_TOOLS: ToolDefinition[]; /** * Dotted tool names served by the HTTP endpoint before the snake_case * consolidation. * * Accepted by `dispatch` but deliberately absent from `listTools()`: any client * pinned to an old name keeps working, while directories and new clients only * ever see one canonical catalogue. Remove after the deprecation window. */ export declare const LEGACY_ALIASES: Record; export declare function resolveTool(name: string): ToolDefinition | undefined; /** The advertised catalogue, in MCP `tools/list` wire shape. */ export declare function listTools(): { name: string; description: string; inputSchema: import("./lib/types.js").JsonSchema; annotations: import("./lib/types.js").ToolAnnotations; }[]; export declare class UnknownToolError extends Error { constructor(name: string); } export declare class MissingScopeError extends Error { readonly required: ToolScope[]; constructor(required: ToolScope[]); } /** * Decides whether the caller may run a tool requiring any of `required`. * * A predicate rather than a scope array on purpose: MisarMail's own * `hasAnyScope` implements a full-access wildcard that also excludes a set of * privileged scopes, and re-deriving that here would silently diverge from the * REST API's authorisation. The host passes its real checker instead. */ export type ScopeChecker = (required: ToolScope[]) => boolean; /** * Run a tool by name. * * `checkScopes` is the host's authorisation predicate; pass `null` to skip the * check — the stdio transport cannot see key scopes, and the API enforces them * server-side on every call anyway. */ export declare function dispatch(name: string, args: Record, ctx: McpContext, checkScopes?: ScopeChecker | null): Promise; export { type ToolDefinition, type ToolScope } from "./lib/types.js"; //# sourceMappingURL=registry.d.ts.map