const SEARCH_TOOL = "cbm_search_tools"; /** Advanced graph tools loaded on demand through `cbm_search_tools`. */ export const LAZY_TOOLS = new Set([ "cbm_query_graph", "cbm_trace_path", "cbm_detect_changes", "cbm_manage_adr", "cbm_ingest_traces", "cbm_get_graph_schema", "cbm_get_architecture", "cbm_check_index_coverage", ]); /** * Schema-less tools emitted by codebase-memory-mcp's obsolete Pi generator. * * They use the removed `{ name, run }` registration shape, which leaves their * provider payload without a description or input schema. Claude rejects the * whole request when any one of these tools is active. This package provides * the supported `cbm_*` replacements, so the legacy tools must stay inactive. */ export const LEGACY_SCHEMALESS_TOOLS = new Set([ "index_repository", "search_graph", "query_graph", "trace_path", "get_code_snippet", "get_graph_schema", "get_architecture", "search_code", "list_projects", "delete_project", "index_status", "check_index_coverage", "detect_changes", "manage_adr", "ingest_traces", ]); /** Return the active tool set for a fresh session. */ export function initialActiveTools(active: readonly string[]): string[] { const keep = active.filter( (name) => !LAZY_TOOLS.has(name) && !LEGACY_SCHEMALESS_TOOLS.has(name), ); return [...new Set([...keep, SEARCH_TOOL])]; }