/** * src/tools/index.ts — MCP tool registry. * * Pulls the canonical tool-name list from `SKILLFM_TOOL_NAMES` (vendored * contract beacon-mcp-tools-v1) and registers a handler for each: * - 8 "key" tools have real handlers (Phase 0 mock-backed) * - 25+ remaining names → `_placeholder` returning TOOL_NOT_IMPLEMENTED * * `registerAllTools(server, deps)` is the single entry point the MCP server * calls in src/index.ts. We use minimal zod schemas for each tool's input — * just enough to satisfy the MCP SDK's `inputSchema` requirement; deeper * validation lives inside each handler (so violations come back as * SkillFmToolError envelopes, not MCP protocol errors). * * TODO Week 5: * - Replace `z.object({}).passthrough()` placeholder schemas with real zod * schemas derived from the vendored contract types. * - Add per-tool `description` strings (English; agents read these to * match Tool Search) — keep them keyword-rich per PRD-MCP-SKILL §4. * - Track tool-call telemetry: invocation count + latency histogram. * - Add `outputSchema` (MCP SDK supports it as of 1.1) for each Phase-0 * handler with a real Output type. */ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { BrainClient } from '../brain-client.js'; import type { MemoryStore } from '../../memory/index.js'; import type { Vault } from '../../vault/index.js'; import type { LocalUsageStore } from '../../usage-local/index.js'; import type { ReconciliationEngine } from '../../reconciliation/index.js'; export interface ToolRegistryDeps { brain: BrainClient; /** Phase 0: derived from `agentToken !== null`; Week 5: real claim. */ isProTier: boolean; /** Mem0 self-host client (Day 6 B1, Pro-only); null = 未配置, MCP tools 返 NOT_CONFIGURED */ memory?: MemoryStore | null; /** Local credential vault (BYOK: keys 加密存本地节点 ~/.skillfm/vault.{key,enc}, 不出节点) */ vault?: Vault | null; /** Beacon V2: 本地 trajectory 聚合 store (PRD §4.1 / §6) */ usageStore?: LocalUsageStore | null; /** Beacon V2: L0+L1+L2 三口径对账 engine (PRD §5) */ reconciliationEngine?: ReconciliationEngine | null; } /** * Register every Phase 0 beacon MCP tool. Called once by src/index.ts on * server bootstrap. */ export declare function registerAllTools(server: McpServer, deps: ToolRegistryDeps): void; /** For tests / sanity checks. Not part of the public package surface. */ export declare function _listAllRegisteredToolNames(): string[]; //# sourceMappingURL=index.d.ts.map