@kolivri/memoreal-mcp 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/schemas.mjs CHANGED
@@ -36,7 +36,7 @@ export const AGENT_WINGS = Object.freeze([
36
36
  ]);
37
37
 
38
38
  export const MCP_SERVER_INSTRUCTIONS =
39
- 'Memoreal Cloud provides deterministic long-term memory and code intelligence across sessions. If unauthenticated or MEMOREAL_API_KEY is missing, run the 3-Click Interactive In-Chat Wizard via AskUserQuestion (in Claude Code) or question (in OpenCode & Cursor) and never ask users to paste raw API keys into chat: Step 1 ("Connect in 1 Click via Google / Browser (Recommended)" vs "Skip for this session"), Step 2 (call connect_account with action: "start", present the verification link /connect?code=XXXX-YYYY, and offer the "I clicked Authorize — Verify" card calling connect_account with action: "status"), and Step 3 ("Yes — Index repo now (Recommended)" vs "Later"). At session start, call build_context with the workspace namespace and a task query (plus health in parallel). Before re-reading files or assuming missing context, call recall_memories, search_code, or explain_code. Persist durable architectural decisions, root causes, and user rules via encode_memory or batch_encode, rate recalled items with feedback, and run consolidate periodically to merge duplicates.';
39
+ 'Memoreal Cloud provides deterministic long-term memory and code intelligence across sessions. If unauthenticated or MEMOREAL_API_KEY is missing, run the 3-Click Interactive In-Chat Wizard via AskUserQuestion (in Claude Code) or question (in OpenCode & Cursor) and never ask users to paste raw API keys into chat: Step 1 ("Connect in 1 Click via Google / Browser (Recommended)" vs "Skip for this session"), Step 2 (call connect_account with action: "start", present the verification link /connect?code=XXXX-YYYY, and offer the "I clicked Authorize — Verify" card calling connect_account with action: "status"), and Step 3 ("Yes — Index repo now (Recommended)" vs "Later", calling bootstrap_project for Turn-1 cold-start repo indexing). At session start, call build_context with a task query (namespace auto-resolves from the repository manifest/git root when omitted; health in parallel). Before re-reading files or assuming missing context, call recall_memories, search_code, or explain_code, or use deterministic code-intelligence tools (find_file, find_references, impact, call_tree, navigate, get_hierarchy). Call bootstrap_project to index documentation and code symbols on initial repository setup. Persist durable architectural decisions, root causes, and user rules via encode_memory or batch_encode, rate recalled items with feedback, and run consolidate periodically to merge duplicates.';
40
40
 
41
41
  export const MCP_TOOLS = Object.freeze([
42
42
  {
@@ -525,6 +525,434 @@ export const MCP_TOOLS = Object.freeze([
525
525
  required: ['status', 'message'],
526
526
  },
527
527
  },
528
+ {
529
+ name: 'find_file',
530
+ title: 'Find Files',
531
+ description:
532
+ 'Find files or directories whose path matches a name, substring, or glob pattern, ordered shallowest first (read-only, idempotent). Use when locating a file or directory path in the repository; use search_code instead to search for symbol definitions, or find_references for identifier call sites.',
533
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
534
+ inputSchema: {
535
+ type: 'object',
536
+ properties: {
537
+ query: { type: 'string', description: 'File path substring, name, or pattern to match.' },
538
+ limit: { type: 'integer', default: 20, description: 'Maximum number of matching file paths to return (default 20).' },
539
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
540
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
541
+ },
542
+ required: ['query'],
543
+ },
544
+ outputSchema: {
545
+ type: 'object',
546
+ properties: {
547
+ files: { type: 'array', items: { type: 'string' }, description: 'Matching relative file paths ordered shallowest first.' },
548
+ total_candidates: { type: 'integer', description: 'Total candidate files evaluated.' },
549
+ },
550
+ required: ['files'],
551
+ },
552
+ },
553
+ {
554
+ name: 'find_references',
555
+ title: 'Find Identifier References',
556
+ description:
557
+ 'Find every place a symbol is referenced as a whole identifier across the indexed project, returning structured hits with file, line, and snippet (read-only, idempotent). Use before changing a function signature or renaming a symbol to inspect all call sites; use search_code instead to find definitions, or impact for transitive blast radius.',
558
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
559
+ inputSchema: {
560
+ type: 'object',
561
+ properties: {
562
+ symbol: { type: 'string', description: 'Identifier or symbol name to search across project references.' },
563
+ limit: { type: 'integer', default: 50, description: 'Maximum number of reference locations to return (default 50).' },
564
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
565
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
566
+ },
567
+ required: ['symbol'],
568
+ },
569
+ outputSchema: {
570
+ type: 'object',
571
+ properties: {
572
+ references: { type: 'array', items: { type: 'object' }, description: 'Structured reference occurrences with file, line, and snippet.' },
573
+ total_candidates: { type: 'integer', description: 'Total reference candidates evaluated.' },
574
+ },
575
+ required: ['references'],
576
+ },
577
+ },
578
+ {
579
+ name: 'impact',
580
+ title: 'Symbol Blast Radius',
581
+ description:
582
+ 'Calculate the transitive blast radius of a symbol change via reverse-call walk, graded by confidence (read-only, idempotent). Use before refactoring or deleting a symbol to know every definition that could break; use diff_risk instead when reviewing an already-staged set of changed symbols.',
583
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
584
+ inputSchema: {
585
+ type: 'object',
586
+ properties: {
587
+ symbol: { type: 'string', description: 'Qualified or bare symbol identifier to evaluate for blast radius.' },
588
+ max_depth: { type: 'integer', default: 5, description: 'Maximum transitive call depth to traverse (default 5).' },
589
+ limit: { type: 'integer', default: 200, description: 'Maximum affected definitions to return (default 200).' },
590
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
591
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
592
+ },
593
+ required: ['symbol'],
594
+ },
595
+ outputSchema: {
596
+ type: 'object',
597
+ properties: {
598
+ affected: { type: 'array', items: { type: 'object' }, description: 'Definitions affected by changing this symbol, graded by confidence.' },
599
+ total_candidates: { type: 'integer', description: 'Total affected candidates evaluated.' },
600
+ },
601
+ required: ['affected'],
602
+ },
603
+ },
604
+ {
605
+ name: 'call_tree',
606
+ title: 'Symbol Call Tree',
607
+ description:
608
+ 'Generate a nested caller ("in") or callee ("out") tree for a symbol, guarded against recursion cycles (read-only, idempotent). Use when exploring how execution flows into or out of a function; use impact instead for a flat transitive blast radius list.',
609
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
610
+ inputSchema: {
611
+ type: 'object',
612
+ properties: {
613
+ symbol: { type: 'string', description: 'Target symbol identifier to inspect.' },
614
+ direction: { type: 'string', enum: ['in', 'out'], default: 'in', description: 'Call direction: "in" for callers (who calls this) or "out" for callees (who this calls).' },
615
+ max_depth: { type: 'integer', default: 5, description: 'Maximum tree depth (default 5).' },
616
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
617
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
618
+ },
619
+ required: ['symbol'],
620
+ },
621
+ outputSchema: {
622
+ type: 'object',
623
+ properties: {
624
+ tree: { type: 'object', description: 'Nested call tree root with callers or callees.' },
625
+ direction: { type: 'string', enum: ['in', 'out'], description: 'Resolved call tree traversal direction.' },
626
+ },
627
+ required: ['tree'],
628
+ },
629
+ },
630
+ {
631
+ name: 'navigate',
632
+ title: 'Navigate Hierarchical Memory Map',
633
+ description:
634
+ 'Navigate a hierarchical repository memory map supporting zoom in/out, next/previous sibling, and peek at content (read-only, idempotent). Use when exploring code organization hierarchically from project root down to modules; use get_hierarchy instead for an immediate vertical ancestor and descendant view.',
635
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
636
+ inputSchema: {
637
+ type: 'object',
638
+ properties: {
639
+ cursor: { type: 'string', description: 'Current node ID (omit to start from root).' },
640
+ move: { description: 'Navigation move: "ZoomOut", "Next", "Prev", or an action object like { ZoomIn: { child: "id" } }.' },
641
+ max_children: { type: 'integer', default: 40, description: 'Cap on child nodes returned (default 40).' },
642
+ token_budget: { type: 'integer', default: 2048, description: 'Advisory token budget hint (default 2048).' },
643
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
644
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
645
+ },
646
+ required: [],
647
+ },
648
+ outputSchema: {
649
+ type: 'object',
650
+ properties: {
651
+ node: { type: 'object', description: 'Current node details and metadata.' },
652
+ children: { type: 'array', items: { type: 'object' }, description: 'Child nodes at the current level.' },
653
+ },
654
+ required: ['node'],
655
+ },
656
+ },
657
+ {
658
+ name: 'get_hierarchy',
659
+ title: 'Get Item Vertical Hierarchy',
660
+ description:
661
+ 'Retrieve every layer connected hierarchically to an item, including all ancestors (project to file) and descendant subtrees (read-only, idempotent). Use when you need the complete vertical context of a file or symbol in one call; use navigate instead to step interactively through sibling nodes.',
662
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
663
+ inputSchema: {
664
+ type: 'object',
665
+ properties: {
666
+ node: { type: 'string', description: 'The item node ID (from search_code or a navigate cursor).' },
667
+ max_children: { type: 'integer', default: 40, description: 'Cap on descendant nodes returned (default 40).' },
668
+ token_budget: { type: 'integer', default: 2048, description: 'Advisory token budget hint (default 2048).' },
669
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
670
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
671
+ },
672
+ required: [],
673
+ },
674
+ outputSchema: {
675
+ type: 'object',
676
+ properties: {
677
+ ancestors: { type: 'array', items: { type: 'object' }, description: 'Ancestor layer nodes (project -> directory -> file -> symbol).' },
678
+ descendants: { type: 'array', items: { type: 'object' }, description: 'Descendant subtree nodes under this item.' },
679
+ descendants_total: { type: 'integer', description: 'Total descendant count.' },
680
+ },
681
+ required: ['ancestors', 'descendants'],
682
+ },
683
+ },
684
+ {
685
+ name: 'implementors',
686
+ title: 'Find Trait or Interface Implementors',
687
+ description:
688
+ 'Find all types, classes, or structs implementing a specific trait or interface (read-only, idempotent). Use when inspecting polymorphic implementations or interface contracts; use search_code instead to locate the trait definition itself.',
689
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
690
+ inputSchema: {
691
+ type: 'object',
692
+ properties: {
693
+ symbol: { type: 'string', description: 'Trait or interface name (for example "Display" or "AuthService").' },
694
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
695
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
696
+ },
697
+ required: ['symbol'],
698
+ },
699
+ outputSchema: {
700
+ type: 'object',
701
+ properties: {
702
+ implementors: { type: 'array', items: { type: 'object' }, description: 'Types implementing the trait or interface.' },
703
+ total_candidates: { type: 'integer', description: 'Total implementor candidates evaluated.' },
704
+ },
705
+ required: ['implementors'],
706
+ },
707
+ },
708
+ {
709
+ name: 'dead_code',
710
+ title: 'Detect Dead or Unused Code',
711
+ description:
712
+ 'Identify symbol definitions with zero in-namespace callers as cleanup candidates (read-only, idempotent). Use when auditing repositories for unused or dead functions and classes; use test_gaps instead to find code lacking test coverage.',
713
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
714
+ inputSchema: {
715
+ type: 'object',
716
+ properties: {
717
+ limit: { type: 'integer', default: 200, description: 'Maximum unreferenced candidate definitions to return (default 200).' },
718
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
719
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
720
+ },
721
+ required: [],
722
+ },
723
+ outputSchema: {
724
+ type: 'object',
725
+ properties: {
726
+ candidates: { type: 'array', items: { type: 'object' }, description: 'Definitions with zero in-namespace callers.' },
727
+ caveat: { type: 'string', description: 'Contextual reminder regarding exported entrypoints or dynamic calls.' },
728
+ },
729
+ required: ['candidates'],
730
+ },
731
+ },
732
+ {
733
+ name: 'test_gaps',
734
+ title: 'Find Code Without Test Coverage',
735
+ description:
736
+ 'Discover non-test definitions that are not referenced by any test suite in the project (read-only, idempotent). Use when planning test suites or verifying coverage before merging PRs; use dead_code instead to find symbols with no callers anywhere.',
737
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
738
+ inputSchema: {
739
+ type: 'object',
740
+ properties: {
741
+ limit: { type: 'integer', default: 200, description: 'Maximum uncovered candidate definitions to return (default 200).' },
742
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
743
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
744
+ },
745
+ required: [],
746
+ },
747
+ outputSchema: {
748
+ type: 'object',
749
+ properties: {
750
+ gaps: { type: 'array', items: { type: 'object' }, description: 'Non-test definitions not referenced by any test file.' },
751
+ total_gaps: { type: 'integer', description: 'Total number of uncovered definitions found.' },
752
+ },
753
+ required: ['gaps'],
754
+ },
755
+ },
756
+ {
757
+ name: 'diff_risk',
758
+ title: 'Assess Diff Caller Risk',
759
+ description:
760
+ 'Evaluate direct callers and dependencies at risk for a set of changed symbols or diff (read-only, idempotent). Use before approving or merging PRs to focus code reviews on high-risk blast radius; use explain_diff instead for a prose narrative of diff changes.',
761
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
762
+ inputSchema: {
763
+ type: 'object',
764
+ properties: {
765
+ changed: { type: 'array', items: { type: 'string' }, description: 'Qualified names of changed symbols or modified file paths.' },
766
+ diff: { type: 'string', description: 'Optional unified diff text to extract changed symbols from.' },
767
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
768
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
769
+ },
770
+ required: [],
771
+ },
772
+ outputSchema: {
773
+ type: 'object',
774
+ properties: {
775
+ risks: { type: 'array', items: { type: 'object' }, description: 'Direct callers and downstream dependencies at risk.' },
776
+ summary: { type: 'string', description: 'Risk assessment summary.' },
777
+ },
778
+ required: ['risks'],
779
+ },
780
+ },
781
+ {
782
+ name: 'downstream_effects',
783
+ title: 'Trace Downstream Causal Effects',
784
+ description:
785
+ 'Walk causal graph edges downstream from a memory to identify consequences and cascading effects (read-only, idempotent). Use after an incident or decision to see what downstream behaviors were influenced; use root_cause instead to walk upstream to originating causes.',
786
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
787
+ inputSchema: {
788
+ type: 'object',
789
+ properties: {
790
+ id: { type: 'string', description: 'Source memory or incident UUID to trace effects from.' },
791
+ max_depth: { type: 'integer', default: 8, description: 'Maximum causal edge traversal depth (default 8).' },
792
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
793
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
794
+ },
795
+ required: ['id'],
796
+ },
797
+ outputSchema: {
798
+ type: 'object',
799
+ properties: {
800
+ effects: { type: 'array', items: { type: 'object' }, description: 'Downstream causal consequences and linked memory records.' },
801
+ depth_reached: { type: 'integer', description: 'Maximum traversal depth explored.' },
802
+ },
803
+ required: ['effects'],
804
+ },
805
+ },
806
+ {
807
+ name: 'root_cause',
808
+ title: 'Trace Root Cause Upstream',
809
+ description:
810
+ 'Walk causal graph edges upstream from an incident or bug memory to its originating cause (read-only, idempotent). Use when diagnosing why a regression or failure occurred; use downstream_effects instead to see what a decision impacted.',
811
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
812
+ inputSchema: {
813
+ type: 'object',
814
+ properties: {
815
+ id: { type: 'string', description: 'Target error, incident, or memory UUID to trace upstream.' },
816
+ max_depth: { type: 'integer', default: 8, description: 'Maximum causal edge traversal depth (default 8).' },
817
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
818
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
819
+ },
820
+ required: ['id'],
821
+ },
822
+ outputSchema: {
823
+ type: 'object',
824
+ properties: {
825
+ causes: { type: 'array', items: { type: 'object' }, description: 'Upstream causal path memories terminating at originating root cause.' },
826
+ root_cause_id: { type: 'string', description: 'UUID of the primary originating root cause.' },
827
+ },
828
+ required: ['causes'],
829
+ },
830
+ },
831
+ {
832
+ name: 'trace_provenance',
833
+ title: 'Trace Memory Provenance Chain',
834
+ description:
835
+ 'Trace a memory record DerivedFrom provenance chain and combined trust score (read-only, idempotent). Use when verifying the lineage or authenticity of a learned fact; use root_cause instead to diagnose the cause of an incident.',
836
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
837
+ inputSchema: {
838
+ type: 'object',
839
+ properties: {
840
+ id: { type: 'string', description: 'Target memory UUID to trace provenance for.' },
841
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
842
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
843
+ },
844
+ required: ['id'],
845
+ },
846
+ outputSchema: {
847
+ type: 'object',
848
+ properties: {
849
+ chain: { type: 'array', items: { type: 'object' }, description: 'Ordered derivation chain from original source to current memory.' },
850
+ trust_score: { type: 'number', description: 'Combined provenance trust score (0.0-1.0).' },
851
+ },
852
+ required: ['chain'],
853
+ },
854
+ },
855
+ {
856
+ name: 'explain_diff',
857
+ title: 'Explain Unified Diff',
858
+ description:
859
+ 'Synthesize natural-language analysis of a unified diff against indexed code definitions and architectural memories (read-only, idempotent). Use when reviewing code changes before committing or merging; use diff_risk instead for structured caller risk ratings.',
860
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
861
+ inputSchema: {
862
+ type: 'object',
863
+ properties: {
864
+ diff: { type: 'string', description: 'Unified git diff text to analyze.' },
865
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
866
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
867
+ },
868
+ required: ['diff'],
869
+ },
870
+ outputSchema: {
871
+ type: 'object',
872
+ properties: {
873
+ explanation: { type: 'string', description: 'Natural-language summary and architectural analysis of the diff.' },
874
+ impacted_symbols: { type: 'array', items: { type: 'string' }, description: 'List of symbols modified in the diff.' },
875
+ },
876
+ required: ['explanation'],
877
+ },
878
+ },
879
+ {
880
+ name: 'explain_error',
881
+ title: 'Explain Error or Stack Trace',
882
+ description:
883
+ 'Analyze an error message or stack trace against indexed repository code and prior debugging memories (read-only, idempotent). Use when troubleshooting runtime errors, panics, or test failures; use root_cause instead when traversing causal graph records.',
884
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
885
+ inputSchema: {
886
+ type: 'object',
887
+ properties: {
888
+ error: { type: 'string', description: 'Error message, panic log, or stack trace text to analyze.' },
889
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk.' },
890
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
891
+ },
892
+ required: ['error'],
893
+ },
894
+ outputSchema: {
895
+ type: 'object',
896
+ properties: {
897
+ explanation: { type: 'string', description: 'Analysis of the root cause, failing frames, and suggested fixes.' },
898
+ suggested_fix: { type: 'string', description: 'Actionable code fix or remediation steps.' },
899
+ },
900
+ required: ['explanation'],
901
+ },
902
+ },
903
+ {
904
+ name: 'rename',
905
+ title: 'Prepare Symbol Rename Worklist',
906
+ description:
907
+ 'Generate a reviewed edit worklist (file, line, snippet, and confidence) for renaming a symbol without applying automatic patches (read-only, idempotent). Use before renaming an identifier to review every call site needing changes; use find_references for raw reference search.',
908
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
909
+ inputSchema: {
910
+ type: 'object',
911
+ properties: {
912
+ symbol: { type: 'string', description: 'Current symbol or identifier name to rename.' },
913
+ new_name: { type: 'string', description: 'Proposed new name for the identifier.' },
914
+ limit: { type: 'integer', default: 200, description: 'Maximum occurrences to return in the worklist (default 200).' },
915
+ project_dir: { type: 'string', description: 'Optional local project directory root.' },
916
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to MEMOREAL_NAMESPACE or "default"; never prefix with "org:").' },
917
+ },
918
+ required: ['symbol', 'new_name'],
919
+ },
920
+ outputSchema: {
921
+ type: 'object',
922
+ properties: {
923
+ worklist: { type: 'array', items: { type: 'object' }, description: 'Reviewed list of file, line, and replacement snippets.' },
924
+ total_occurrences: { type: 'integer', description: 'Total number of symbol references requiring update.' },
925
+ },
926
+ required: ['worklist'],
927
+ },
928
+ },
929
+ {
930
+ name: 'bootstrap_project',
931
+ title: 'Bootstrap Project Memory',
932
+ description:
933
+ 'Index local repository documentation (CLAUDE.md, AGENTS.md, README.md) and top-level code symbols into Memoreal Cloud memory in a single Turn-1 bootstrap pass. Use at initial repository setup or session cold start to prime memory without manual entry; use encode_memory instead for single ongoing facts, or search_code to query indexed symbols.',
934
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
935
+ inputSchema: {
936
+ type: 'object',
937
+ properties: {
938
+ project_dir: { type: 'string', description: 'Optional project root directory on local disk (defaults to current working directory).' },
939
+ path: { type: 'string', description: 'Alias for project_dir.' },
940
+ namespace: { type: 'string', description: 'Logical workspace namespace (defaults to auto-derived canonical namespace; never prefix with "org:").' },
941
+ write_ide_rules: { type: 'boolean', default: false, description: 'Whether to write IDE rule files (like .cursor/rules/memoreal.mdc) with .bak backups.' },
942
+ },
943
+ required: [],
944
+ },
945
+ outputSchema: {
946
+ type: 'object',
947
+ properties: {
948
+ bootstrapped: { type: 'boolean', description: 'True if repository documentation and symbols were indexed.' },
949
+ namespace: { type: 'string', description: 'Canonical project namespace used for indexing.' },
950
+ imported_files: { type: 'array', items: { type: 'string' }, description: 'Project documentation files imported into semantic memory.' },
951
+ symbols_indexed: { type: 'integer', description: 'Number of code symbol definitions batched into cloud memory.' },
952
+ },
953
+ required: ['bootstrapped', 'namespace'],
954
+ },
955
+ },
528
956
  ]);
529
957
 
530
958
  export const MCP_RESOURCES = Object.freeze([