obsidian-mcp-server 3.1.10 → 3.2.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.
Files changed (44) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +14 -13
  3. package/changelog/3.1.x/3.1.11.md +20 -0
  4. package/changelog/3.2.x/3.2.0.md +49 -0
  5. package/dist/config/server-config.d.ts +1 -0
  6. package/dist/config/server-config.d.ts.map +1 -1
  7. package/dist/config/server-config.js +14 -2
  8. package/dist/config/server-config.js.map +1 -1
  9. package/dist/index.d.ts +4 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +27 -10
  12. package/dist/index.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/_shared/regex-safety.d.ts +18 -0
  14. package/dist/mcp-server/tools/definitions/_shared/regex-safety.d.ts.map +1 -0
  15. package/dist/mcp-server/tools/definitions/_shared/regex-safety.js +34 -0
  16. package/dist/mcp-server/tools/definitions/_shared/regex-safety.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/_shared/schemas.js +1 -1
  18. package/dist/mcp-server/tools/definitions/_shared/schemas.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/index.d.ts +48 -832
  20. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/index.js +10 -6
  22. package/dist/mcp-server/tools/definitions/index.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts +21 -2
  24. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js +59 -6
  26. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts +21 -3
  28. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +59 -7
  30. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +175 -19
  32. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +249 -134
  34. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
  35. package/dist/services/obsidian/obsidian-service.d.ts +33 -4
  36. package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
  37. package/dist/services/obsidian/obsidian-service.js +164 -19
  38. package/dist/services/obsidian/obsidian-service.js.map +1 -1
  39. package/dist/services/obsidian/path-policy.js +7 -2
  40. package/dist/services/obsidian/path-policy.js.map +1 -1
  41. package/dist/services/obsidian/types.d.ts +25 -1
  42. package/dist/services/obsidian/types.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/server.json +3 -3
@@ -4,10 +4,18 @@
4
4
  * when `OBSIDIAN_READ_ONLY=true`. The command-palette pair is exported
5
5
  * separately so the entry point wraps it with `disabledTool()` when either
6
6
  * `OBSIDIAN_ENABLE_COMMANDS=false` or `OBSIDIAN_READ_ONLY=true` — keeping this
7
- * module free of eager config reads.
7
+ * module free of eager config reads. `obsidian_search_notes` is exposed as a
8
+ * factory (`buildSearchNotesTool`) because its mode enum is conditional on
9
+ * Omnisearch reachability, which is only known after the startup probe runs.
8
10
  * @module mcp-server/tools/definitions/index
9
11
  */
10
- /** Read-only tools — always registered, even with `OBSIDIAN_READ_ONLY=true`. */
12
+ export { buildSearchNotesTool } from './obsidian-search-notes.tool.js';
13
+ /**
14
+ * Read-only tools that don't depend on runtime probes — always registered,
15
+ * even with `OBSIDIAN_READ_ONLY=true`. `obsidian_search_notes` is constructed
16
+ * separately in the entry point via `buildSearchNotesTool` so its mode enum
17
+ * can reflect Omnisearch reachability.
18
+ */
11
19
  export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
12
20
  format: import("zod").ZodEnum<{
13
21
  content: "content";
@@ -163,12 +171,27 @@ export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
163
171
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
164
172
  readonly when: "The supplied `path` does not exist in the vault. Sub-directories that disappear mid-walk are silently skipped — only the root path surfaces this error.";
165
173
  readonly recovery: "List a parent directory to find the correct casing or check the spelling.";
166
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
174
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
175
+ nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
176
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
167
177
  tags: import("zod").ZodArray<import("zod").ZodObject<{
168
178
  name: import("zod").ZodString;
169
179
  count: import("zod").ZodNumber;
170
180
  }, import("zod/v4/core").$strip>>;
171
- }, import("zod/v4/core").$strip>, undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
181
+ appliedFilters: import("zod").ZodOptional<import("zod").ZodObject<{
182
+ nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
183
+ }, import("zod/v4/core").$strip>>;
184
+ }, import("zod/v4/core").$strip>, readonly [{
185
+ readonly reason: "regex_invalid";
186
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
187
+ readonly when: "The supplied `nameRegex` is not a valid ECMAScript regex.";
188
+ readonly recovery: "Use a valid ECMAScript regex (e.g. `^mcp/.*`), or omit nameRegex to disable filtering.";
189
+ }, {
190
+ readonly reason: "regex_unsafe";
191
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
192
+ readonly when: "The supplied `nameRegex` is well-formed but exceeds the 256-character limit or contains nested quantifiers known to cause catastrophic backtracking.";
193
+ readonly recovery: "Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern (e.g. `^mcp/.*`), or omit nameRegex to disable filtering.";
194
+ }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
172
195
  path: import("zod").ZodString;
173
196
  failIfMissing: import("zod").ZodDefault<import("zod").ZodBoolean>;
174
197
  newLeaf: import("zod").ZodDefault<import("zod").ZodBoolean>;
@@ -191,73 +214,6 @@ export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
191
214
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
192
215
  readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only).";
193
216
  readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data.";
194
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
195
- mode: import("zod").ZodEnum<{
196
- text: "text";
197
- dataview: "dataview";
198
- jsonlogic: "jsonlogic";
199
- }>;
200
- query: import("zod").ZodOptional<import("zod").ZodString>;
201
- logic: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
202
- contextLength: import("zod").ZodDefault<import("zod").ZodNumber>;
203
- pathPrefix: import("zod").ZodOptional<import("zod").ZodString>;
204
- maxMatchesPerHit: import("zod").ZodDefault<import("zod").ZodNumber>;
205
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
206
- result: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
207
- mode: import("zod").ZodLiteral<"text">;
208
- hits: import("zod").ZodArray<import("zod").ZodObject<{
209
- filename: import("zod").ZodString;
210
- score: import("zod").ZodOptional<import("zod").ZodNumber>;
211
- matches: import("zod").ZodArray<import("zod").ZodObject<{
212
- context: import("zod").ZodString;
213
- match: import("zod").ZodObject<{
214
- start: import("zod").ZodNumber;
215
- end: import("zod").ZodNumber;
216
- }, import("zod/v4/core").$strip>;
217
- }, import("zod/v4/core").$strip>>;
218
- totalMatches: import("zod").ZodOptional<import("zod").ZodNumber>;
219
- truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
220
- }, import("zod/v4/core").$strip>>;
221
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
222
- count: import("zod").ZodNumber;
223
- hint: import("zod").ZodString;
224
- }, import("zod/v4/core").$strip>>;
225
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
226
- mode: import("zod").ZodLiteral<"dataview">;
227
- hits: import("zod").ZodArray<import("zod").ZodObject<{
228
- filename: import("zod").ZodString;
229
- result: import("zod").ZodUnknown;
230
- }, import("zod/v4/core").$strip>>;
231
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
232
- count: import("zod").ZodNumber;
233
- hint: import("zod").ZodString;
234
- }, import("zod/v4/core").$strip>>;
235
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
236
- mode: import("zod").ZodLiteral<"jsonlogic">;
237
- hits: import("zod").ZodArray<import("zod").ZodObject<{
238
- filename: import("zod").ZodString;
239
- result: import("zod").ZodUnknown;
240
- }, import("zod/v4/core").$strip>>;
241
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
242
- count: import("zod").ZodNumber;
243
- hint: import("zod").ZodString;
244
- }, import("zod/v4/core").$strip>>;
245
- }, import("zod/v4/core").$strip>], "mode">;
246
- }, import("zod/v4/core").$strip>, readonly [{
247
- readonly reason: "path_prefix_invalid_mode";
248
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
249
- readonly when: "`pathPrefix` was provided in a non-text mode (only `text` supports prefix filtering).";
250
- readonly recovery: "Drop pathPrefix or switch mode to text for prefix filtering.";
251
- }, {
252
- readonly reason: "query_required";
253
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
254
- readonly when: "`query` is missing for `text` or `dataview` mode (required for both).";
255
- readonly recovery: "Pass `query` — search terms for text mode (e.g. \"TODO\"), or DQL like \"TABLE WHERE file.mtime > date(today)\" for dataview mode.";
256
- }, {
257
- readonly reason: "logic_required";
258
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
259
- readonly when: "`logic` is missing for `jsonlogic` mode.";
260
- readonly recovery: "Pass a JSONLogic tree as `logic`, e.g. `{\"glob\": [{\"var\": \"path\"}, \"Projects/*.md\"]}`.";
261
217
  }]>)[];
262
218
  /** Write tools — wrapped with `disabledTool()` when `OBSIDIAN_READ_ONLY=true`. */
263
219
  export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
@@ -764,776 +720,36 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
764
720
  readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
765
721
  readonly recovery: "Call obsidian_get_note with format document-map to discover available targets.";
766
722
  }]>)[];
767
- /** Combined base set — preserves the previous registration order. */
768
- export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
769
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
770
- type: import("zod").ZodLiteral<"path">;
771
- path: import("zod").ZodString;
772
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
773
- type: import("zod").ZodLiteral<"active">;
774
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
775
- type: import("zod").ZodLiteral<"periodic">;
776
- period: import("zod").ZodEnum<{
777
- daily: "daily";
778
- weekly: "weekly";
779
- monthly: "monthly";
780
- quarterly: "quarterly";
781
- yearly: "yearly";
782
- }>;
783
- date: import("zod").ZodOptional<import("zod").ZodString>;
784
- }, import("zod/v4/core").$strip>], "type">;
785
- content: import("zod").ZodString;
786
- section: import("zod").ZodOptional<import("zod").ZodObject<{
787
- type: import("zod").ZodEnum<{
788
- heading: "heading";
789
- block: "block";
790
- frontmatter: "frontmatter";
791
- }>;
792
- target: import("zod").ZodString;
793
- }, import("zod/v4/core").$strip>>;
794
- contentType: import("zod").ZodDefault<import("zod").ZodEnum<{
795
- markdown: "markdown";
796
- json: "json";
797
- }>>;
798
- createTargetIfMissing: import("zod").ZodDefault<import("zod").ZodBoolean>;
723
+ /** Command-palette tools — opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`; suppressed by `OBSIDIAN_READ_ONLY=true`. */
724
+ export declare const commandToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
725
+ commandId: import("zod").ZodString;
799
726
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
800
- path: import("zod").ZodString;
801
- sectionTargeted: import("zod").ZodBoolean;
802
- created: import("zod").ZodBoolean;
803
- previousSizeInBytes: import("zod").ZodNumber;
804
- currentSizeInBytes: import("zod").ZodNumber;
727
+ commandId: import("zod").ZodString;
728
+ executed: import("zod").ZodBoolean;
805
729
  }, import("zod/v4/core").$strip>, readonly [{
806
- readonly reason: "path_forbidden";
807
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
808
- readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
809
- readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
810
- }, {
811
- readonly reason: "note_missing";
812
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
813
- readonly when: "Section append targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
814
- readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file append (which creates the note if missing).";
815
- }, {
816
- readonly reason: "no_active_file";
817
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
818
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
819
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
820
- }, {
821
- readonly reason: "periodic_not_found";
730
+ readonly reason: "command_unknown";
822
731
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
823
- readonly when: "Target was `periodic` but no matching periodic note exists.";
824
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
825
- }, {
826
- readonly reason: "periodic_disabled";
827
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
828
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
829
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
830
- }, {
831
- readonly reason: "section_target_missing";
832
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
833
- readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
834
- readonly recovery: "Call obsidian_get_note with format document-map to discover available targets, or pass createTargetIfMissing: true to bring it into existence.";
732
+ readonly when: "The supplied `commandId` is not registered in Obsidian. Use `obsidian_list_commands` to discover valid IDs.";
733
+ readonly recovery: "Call obsidian_list_commands to discover the registered command IDs.";
835
734
  }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
836
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
837
- type: import("zod").ZodLiteral<"path">;
838
- path: import("zod").ZodString;
839
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
840
- type: import("zod").ZodLiteral<"active">;
841
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
842
- type: import("zod").ZodLiteral<"periodic">;
843
- period: import("zod").ZodEnum<{
844
- daily: "daily";
845
- weekly: "weekly";
846
- monthly: "monthly";
847
- quarterly: "quarterly";
848
- yearly: "yearly";
849
- }>;
850
- date: import("zod").ZodOptional<import("zod").ZodString>;
851
- }, import("zod/v4/core").$strip>], "type">;
735
+ nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
852
736
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
853
- path: import("zod").ZodString;
854
- deleted: import("zod").ZodBoolean;
855
- previousSizeInBytes: import("zod").ZodNumber;
856
- currentSizeInBytes: import("zod").ZodNumber;
857
- }, import("zod/v4/core").$strip>, readonly [{
858
- readonly reason: "path_forbidden";
859
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
860
- readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
861
- readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
862
- }, {
863
- readonly reason: "cancelled";
864
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.InvalidRequest;
865
- readonly when: "User declined the deletion via interactive elicitation.";
866
- readonly recovery: "Re-run the tool when the user is ready to confirm deletion.";
867
- }, {
868
- readonly reason: "note_missing";
869
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
870
- readonly when: "The vault path does not resolve to an existing note.";
871
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
872
- }, {
873
- readonly reason: "no_active_file";
874
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
875
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
876
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
877
- }, {
878
- readonly reason: "periodic_not_found";
879
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
880
- readonly when: "Target was `periodic` but no matching periodic note exists.";
881
- readonly recovery: "Pass an explicit path target — periodic notes must already exist.";
882
- }, {
883
- readonly reason: "periodic_disabled";
884
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
885
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
886
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
887
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
888
- format: import("zod").ZodEnum<{
889
- content: "content";
890
- section: "section";
891
- full: "full";
892
- "document-map": "document-map";
893
- }>;
894
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
895
- type: import("zod").ZodLiteral<"path">;
896
- path: import("zod").ZodString;
897
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
898
- type: import("zod").ZodLiteral<"active">;
899
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
900
- type: import("zod").ZodLiteral<"periodic">;
901
- period: import("zod").ZodEnum<{
902
- daily: "daily";
903
- weekly: "weekly";
904
- monthly: "monthly";
905
- quarterly: "quarterly";
906
- yearly: "yearly";
907
- }>;
908
- date: import("zod").ZodOptional<import("zod").ZodString>;
909
- }, import("zod/v4/core").$strip>], "type">;
910
- section: import("zod").ZodOptional<import("zod").ZodObject<{
911
- type: import("zod").ZodEnum<{
912
- heading: "heading";
913
- block: "block";
914
- frontmatter: "frontmatter";
915
- }>;
916
- target: import("zod").ZodString;
737
+ commands: import("zod").ZodArray<import("zod").ZodObject<{
738
+ id: import("zod").ZodString;
739
+ name: import("zod").ZodString;
740
+ }, import("zod/v4/core").$strip>>;
741
+ appliedFilters: import("zod").ZodOptional<import("zod").ZodObject<{
742
+ nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
917
743
  }, import("zod/v4/core").$strip>>;
918
- includeLinks: import("zod").ZodDefault<import("zod").ZodBoolean>;
919
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
920
- result: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
921
- format: import("zod").ZodLiteral<"content">;
922
- path: import("zod").ZodString;
923
- content: import("zod").ZodString;
924
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
925
- format: import("zod").ZodLiteral<"full">;
926
- path: import("zod").ZodString;
927
- content: import("zod").ZodString;
928
- frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
929
- tags: import("zod").ZodArray<import("zod").ZodString>;
930
- stat: import("zod").ZodObject<{
931
- ctime: import("zod").ZodNumber;
932
- mtime: import("zod").ZodNumber;
933
- size: import("zod").ZodNumber;
934
- }, import("zod/v4/core").$strip>;
935
- outgoingLinks: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
936
- target: import("zod").ZodString;
937
- type: import("zod").ZodEnum<{
938
- markdown: "markdown";
939
- wikilink: "wikilink";
940
- }>;
941
- }, import("zod/v4/core").$strip>>>;
942
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
943
- format: import("zod").ZodLiteral<"document-map">;
944
- path: import("zod").ZodString;
945
- headings: import("zod").ZodArray<import("zod").ZodString>;
946
- blocks: import("zod").ZodArray<import("zod").ZodString>;
947
- frontmatterFields: import("zod").ZodArray<import("zod").ZodString>;
948
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
949
- format: import("zod").ZodLiteral<"section">;
950
- path: import("zod").ZodString;
951
- section: import("zod").ZodObject<{
952
- type: import("zod").ZodEnum<{
953
- heading: "heading";
954
- block: "block";
955
- frontmatter: "frontmatter";
956
- }>;
957
- target: import("zod").ZodString;
958
- }, import("zod/v4/core").$strip>;
959
- valueText: import("zod").ZodOptional<import("zod").ZodString>;
960
- valueJson: import("zod").ZodOptional<import("zod").ZodUnknown>;
961
- }, import("zod/v4/core").$strip>], "format">;
962
744
  }, import("zod/v4/core").$strip>, readonly [{
963
- readonly reason: "section_required";
745
+ readonly reason: "regex_invalid";
964
746
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
965
- readonly when: "`format` is \"section\" but no `section` locator was provided.";
966
- readonly recovery: "Pass `section: { type, target }` (e.g. `{ type: \"heading\", target: \"Intro\" }`), or use `format: \"full\"` / `\"document-map\"` instead.";
967
- }, {
968
- readonly reason: "path_forbidden";
969
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
970
- readonly when: "The target path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access).";
971
- readonly recovery: "Use a path inside the configured read scope. The error data echoes the active scope.";
972
- }, {
973
- readonly reason: "note_missing";
974
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
975
- readonly when: "The vault path does not resolve to an existing note.";
976
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
977
- }, {
978
- readonly reason: "ambiguous_path";
979
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
980
- readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only).";
981
- readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data.";
982
- }, {
983
- readonly reason: "no_active_file";
984
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
985
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
986
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
747
+ readonly when: "The supplied `nameRegex` is not a valid ECMAScript regex.";
748
+ readonly recovery: "Use a valid ECMAScript regex (e.g. `^Templater`), or omit nameRegex to disable filtering.";
987
749
  }, {
988
- readonly reason: "periodic_not_found";
989
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
990
- readonly when: "Target was `periodic` but no matching periodic note exists.";
991
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
992
- }, {
993
- readonly reason: "periodic_disabled";
994
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
995
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
996
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
997
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
998
- path: import("zod").ZodOptional<import("zod").ZodString>;
999
- extension: import("zod").ZodOptional<import("zod").ZodString>;
1000
- nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
1001
- depth: import("zod").ZodDefault<import("zod").ZodNumber>;
1002
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1003
- path: import("zod").ZodString;
1004
- entries: import("zod").ZodArray<import("zod").ZodObject<{
1005
- path: import("zod").ZodString;
1006
- type: import("zod").ZodEnum<{
1007
- file: "file";
1008
- directory: "directory";
1009
- }>;
1010
- truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
1011
- }, import("zod/v4/core").$strip>>;
1012
- totals: import("zod").ZodObject<{
1013
- entries: import("zod").ZodNumber;
1014
- files: import("zod").ZodNumber;
1015
- directories: import("zod").ZodNumber;
1016
- }, import("zod/v4/core").$strip>;
1017
- appliedFilters: import("zod").ZodObject<{
1018
- extension: import("zod").ZodOptional<import("zod").ZodString>;
1019
- nameRegex: import("zod").ZodOptional<import("zod").ZodString>;
1020
- depth: import("zod").ZodNumber;
1021
- }, import("zod/v4/core").$strip>;
1022
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
1023
- reason: import("zod").ZodLiteral<"entry_cap">;
1024
- cap: import("zod").ZodNumber;
1025
- hint: import("zod").ZodString;
1026
- }, import("zod/v4/core").$strip>>;
1027
- }, import("zod/v4/core").$strip>, readonly [{
1028
- readonly reason: "regex_invalid";
1029
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1030
- readonly when: "The supplied `nameRegex` is not a valid ECMAScript regex.";
1031
- readonly recovery: "Use a valid ECMAScript regex (e.g. `^Project.*\\.md$`), or omit nameRegex to disable filtering.";
1032
- }, {
1033
- readonly reason: "path_forbidden";
1034
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1035
- readonly when: "The supplied `path` is outside OBSIDIAN_READ_PATHS (root listings always pass; specific subdirectories must be readable).";
1036
- readonly recovery: "List a directory inside the configured read scope, or omit `path` to list from the vault root. The error data echoes the active scope.";
1037
- }, {
1038
- readonly reason: "note_missing";
1039
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1040
- readonly when: "The supplied `path` does not exist in the vault. Sub-directories that disappear mid-walk are silently skipped — only the root path surfaces this error.";
1041
- readonly recovery: "List a parent directory to find the correct casing or check the spelling.";
1042
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1043
- tags: import("zod").ZodArray<import("zod").ZodObject<{
1044
- name: import("zod").ZodString;
1045
- count: import("zod").ZodNumber;
1046
- }, import("zod/v4/core").$strip>>;
1047
- }, import("zod/v4/core").$strip>, undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1048
- operation: import("zod").ZodEnum<{
1049
- set: "set";
1050
- delete: "delete";
1051
- get: "get";
1052
- }>;
1053
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1054
- type: import("zod").ZodLiteral<"path">;
1055
- path: import("zod").ZodString;
1056
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1057
- type: import("zod").ZodLiteral<"active">;
1058
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1059
- type: import("zod").ZodLiteral<"periodic">;
1060
- period: import("zod").ZodEnum<{
1061
- daily: "daily";
1062
- weekly: "weekly";
1063
- monthly: "monthly";
1064
- quarterly: "quarterly";
1065
- yearly: "yearly";
1066
- }>;
1067
- date: import("zod").ZodOptional<import("zod").ZodString>;
1068
- }, import("zod/v4/core").$strip>], "type">;
1069
- key: import("zod").ZodString;
1070
- value: import("zod").ZodOptional<import("zod").ZodUnknown>;
1071
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1072
- result: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1073
- operation: import("zod").ZodLiteral<"get">;
1074
- path: import("zod").ZodString;
1075
- key: import("zod").ZodString;
1076
- exists: import("zod").ZodBoolean;
1077
- value: import("zod").ZodUnknown;
1078
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1079
- operation: import("zod").ZodLiteral<"set">;
1080
- path: import("zod").ZodString;
1081
- key: import("zod").ZodString;
1082
- frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
1083
- previousSizeInBytes: import("zod").ZodNumber;
1084
- currentSizeInBytes: import("zod").ZodNumber;
1085
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1086
- operation: import("zod").ZodLiteral<"delete">;
1087
- path: import("zod").ZodString;
1088
- key: import("zod").ZodString;
1089
- frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
1090
- previousSizeInBytes: import("zod").ZodNumber;
1091
- currentSizeInBytes: import("zod").ZodNumber;
1092
- }, import("zod/v4/core").$strip>], "operation">;
1093
- }, import("zod/v4/core").$strip>, readonly [{
1094
- readonly reason: "path_forbidden";
1095
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1096
- readonly when: "`get` requires the path to be readable; `set`/`delete` require it to be inside OBSIDIAN_WRITE_PATHS, with OBSIDIAN_READ_ONLY=false.";
1097
- readonly recovery: "Use a path inside the configured scope. The error data echoes the active scope.";
1098
- }, {
1099
- readonly reason: "value_required";
1100
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1101
- readonly when: "`operation` is \"set\" but no `value` was supplied.";
1102
- readonly recovery: "Pass `value` as any JSON-typed value: string, number, boolean, array, or object (e.g. `\"draft\"`, `42`, `true`, `[\"a\",\"b\"]`).";
1103
- }, {
1104
- readonly reason: "note_missing";
1105
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1106
- readonly when: "The vault path does not resolve to an existing note.";
1107
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
1108
- }, {
1109
- readonly reason: "no_active_file";
1110
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1111
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
1112
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
1113
- }, {
1114
- readonly reason: "periodic_not_found";
1115
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1116
- readonly when: "Target was `periodic` but no matching periodic note exists.";
1117
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
1118
- }, {
1119
- readonly reason: "periodic_disabled";
1120
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1121
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
1122
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
1123
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1124
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1125
- type: import("zod").ZodLiteral<"path">;
1126
- path: import("zod").ZodString;
1127
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1128
- type: import("zod").ZodLiteral<"active">;
1129
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1130
- type: import("zod").ZodLiteral<"periodic">;
1131
- period: import("zod").ZodEnum<{
1132
- daily: "daily";
1133
- weekly: "weekly";
1134
- monthly: "monthly";
1135
- quarterly: "quarterly";
1136
- yearly: "yearly";
1137
- }>;
1138
- date: import("zod").ZodOptional<import("zod").ZodString>;
1139
- }, import("zod/v4/core").$strip>], "type">;
1140
- operation: import("zod").ZodEnum<{
1141
- list: "list";
1142
- add: "add";
1143
- remove: "remove";
1144
- }>;
1145
- tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
1146
- location: import("zod").ZodDefault<import("zod").ZodEnum<{
1147
- frontmatter: "frontmatter";
1148
- inline: "inline";
1149
- both: "both";
1150
- }>>;
1151
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1152
- result: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1153
- operation: import("zod").ZodLiteral<"list">;
1154
- path: import("zod").ZodString;
1155
- tags: import("zod").ZodObject<{
1156
- frontmatter: import("zod").ZodArray<import("zod").ZodString>;
1157
- inline: import("zod").ZodArray<import("zod").ZodString>;
1158
- all: import("zod").ZodArray<import("zod").ZodString>;
1159
- }, import("zod/v4/core").$strip>;
1160
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1161
- operation: import("zod").ZodLiteral<"add">;
1162
- path: import("zod").ZodString;
1163
- applied: import("zod").ZodArray<import("zod").ZodString>;
1164
- skipped: import("zod").ZodArray<import("zod").ZodString>;
1165
- tags: import("zod").ZodArray<import("zod").ZodString>;
1166
- previousSizeInBytes: import("zod").ZodNumber;
1167
- currentSizeInBytes: import("zod").ZodNumber;
1168
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1169
- operation: import("zod").ZodLiteral<"remove">;
1170
- path: import("zod").ZodString;
1171
- applied: import("zod").ZodArray<import("zod").ZodString>;
1172
- skipped: import("zod").ZodArray<import("zod").ZodString>;
1173
- tags: import("zod").ZodArray<import("zod").ZodString>;
1174
- previousSizeInBytes: import("zod").ZodNumber;
1175
- currentSizeInBytes: import("zod").ZodNumber;
1176
- }, import("zod/v4/core").$strip>], "operation">;
1177
- }, import("zod/v4/core").$strip>, readonly [{
1178
- readonly reason: "path_forbidden";
1179
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1180
- readonly when: "`list` requires the path to be readable; `add`/`remove` require it to be inside OBSIDIAN_WRITE_PATHS, with OBSIDIAN_READ_ONLY=false.";
1181
- readonly recovery: "Use a path inside the configured scope. The error data echoes the active scope.";
1182
- }, {
1183
- readonly reason: "tags_required";
1184
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1185
- readonly when: "`operation` is \"add\" or \"remove\" but `tags` was empty or omitted.";
1186
- readonly recovery: "Pass a non-empty `tags` array (without `#`), e.g. `[\"draft\", \"wip\"]`.";
1187
- }, {
1188
- readonly reason: "note_missing";
1189
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1190
- readonly when: "The vault path does not resolve to an existing note.";
1191
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
1192
- }, {
1193
- readonly reason: "no_active_file";
1194
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1195
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
1196
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
1197
- }, {
1198
- readonly reason: "periodic_not_found";
1199
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1200
- readonly when: "Target was `periodic` but no matching periodic note exists.";
1201
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
1202
- }, {
1203
- readonly reason: "periodic_disabled";
1204
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1205
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
1206
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
1207
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1208
- path: import("zod").ZodString;
1209
- failIfMissing: import("zod").ZodDefault<import("zod").ZodBoolean>;
1210
- newLeaf: import("zod").ZodDefault<import("zod").ZodBoolean>;
1211
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1212
- path: import("zod").ZodString;
1213
- opened: import("zod").ZodBoolean;
1214
- createdIfMissing: import("zod").ZodBoolean;
1215
- }, import("zod/v4/core").$strip>, readonly [{
1216
- readonly reason: "path_forbidden";
1217
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1218
- readonly when: "The target path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access).";
1219
- readonly recovery: "Use a path inside the configured read scope. The error data echoes the active scope.";
1220
- }, {
1221
- readonly reason: "note_missing";
1222
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1223
- readonly when: "`failIfMissing: true` (default) and the path does not exist in the vault. Pass `failIfMissing: false` to allow Obsidian to create the file on open.";
1224
- readonly recovery: "Verify the path with obsidian_list_notes or pass failIfMissing false to create on open.";
1225
- }, {
1226
- readonly reason: "ambiguous_path";
1227
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
1228
- readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only).";
1229
- readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data.";
1230
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1231
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1232
- type: import("zod").ZodLiteral<"path">;
1233
- path: import("zod").ZodString;
1234
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1235
- type: import("zod").ZodLiteral<"active">;
1236
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1237
- type: import("zod").ZodLiteral<"periodic">;
1238
- period: import("zod").ZodEnum<{
1239
- daily: "daily";
1240
- weekly: "weekly";
1241
- monthly: "monthly";
1242
- quarterly: "quarterly";
1243
- yearly: "yearly";
1244
- }>;
1245
- date: import("zod").ZodOptional<import("zod").ZodString>;
1246
- }, import("zod/v4/core").$strip>], "type">;
1247
- section: import("zod").ZodObject<{
1248
- type: import("zod").ZodEnum<{
1249
- heading: "heading";
1250
- block: "block";
1251
- frontmatter: "frontmatter";
1252
- }>;
1253
- target: import("zod").ZodString;
1254
- }, import("zod/v4/core").$strip>;
1255
- operation: import("zod").ZodEnum<{
1256
- replace: "replace";
1257
- append: "append";
1258
- prepend: "prepend";
1259
- }>;
1260
- content: import("zod").ZodString;
1261
- contentType: import("zod").ZodDefault<import("zod").ZodEnum<{
1262
- markdown: "markdown";
1263
- json: "json";
1264
- }>>;
1265
- patchOptions: import("zod").ZodOptional<import("zod").ZodObject<{
1266
- createTargetIfMissing: import("zod").ZodDefault<import("zod").ZodBoolean>;
1267
- applyIfContentPreexists: import("zod").ZodDefault<import("zod").ZodBoolean>;
1268
- trimTargetWhitespace: import("zod").ZodDefault<import("zod").ZodBoolean>;
1269
- }, import("zod/v4/core").$strip>>;
1270
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1271
- path: import("zod").ZodString;
1272
- section: import("zod").ZodObject<{
1273
- type: import("zod").ZodEnum<{
1274
- heading: "heading";
1275
- block: "block";
1276
- frontmatter: "frontmatter";
1277
- }>;
1278
- target: import("zod").ZodString;
1279
- }, import("zod/v4/core").$strip>;
1280
- operation: import("zod").ZodEnum<{
1281
- replace: "replace";
1282
- append: "append";
1283
- prepend: "prepend";
1284
- }>;
1285
- previousSizeInBytes: import("zod").ZodNumber;
1286
- currentSizeInBytes: import("zod").ZodNumber;
1287
- }, import("zod/v4/core").$strip>, readonly [{
1288
- readonly reason: "path_forbidden";
1289
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1290
- readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
1291
- readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
1292
- }, {
1293
- readonly reason: "note_missing";
1294
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1295
- readonly when: "The vault path does not resolve to an existing note.";
1296
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
1297
- }, {
1298
- readonly reason: "no_active_file";
1299
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1300
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
1301
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
1302
- }, {
1303
- readonly reason: "periodic_not_found";
1304
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1305
- readonly when: "Target was `periodic` but no matching periodic note exists.";
1306
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
1307
- }, {
1308
- readonly reason: "periodic_disabled";
1309
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1310
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
1311
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
1312
- }, {
1313
- readonly reason: "section_target_missing";
1314
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1315
- readonly when: "The named heading/block/frontmatter field does not exist in the note. Use `obsidian_get_note` with `format: \"document-map\"` to discover available targets.";
1316
- readonly recovery: "Call obsidian_get_note with format document-map to discover the available targets.";
1317
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1318
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1319
- type: import("zod").ZodLiteral<"path">;
1320
- path: import("zod").ZodString;
1321
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1322
- type: import("zod").ZodLiteral<"active">;
1323
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1324
- type: import("zod").ZodLiteral<"periodic">;
1325
- period: import("zod").ZodEnum<{
1326
- daily: "daily";
1327
- weekly: "weekly";
1328
- monthly: "monthly";
1329
- quarterly: "quarterly";
1330
- yearly: "yearly";
1331
- }>;
1332
- date: import("zod").ZodOptional<import("zod").ZodString>;
1333
- }, import("zod/v4/core").$strip>], "type">;
1334
- replacements: import("zod").ZodArray<import("zod").ZodObject<{
1335
- search: import("zod").ZodString;
1336
- replace: import("zod").ZodString;
1337
- useRegex: import("zod").ZodDefault<import("zod").ZodBoolean>;
1338
- caseSensitive: import("zod").ZodDefault<import("zod").ZodBoolean>;
1339
- wholeWord: import("zod").ZodDefault<import("zod").ZodBoolean>;
1340
- flexibleWhitespace: import("zod").ZodDefault<import("zod").ZodBoolean>;
1341
- replaceAll: import("zod").ZodDefault<import("zod").ZodBoolean>;
1342
- }, import("zod/v4/core").$strip>>;
1343
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1344
- path: import("zod").ZodString;
1345
- totalReplacements: import("zod").ZodNumber;
1346
- perReplacement: import("zod").ZodArray<import("zod").ZodObject<{
1347
- search: import("zod").ZodString;
1348
- count: import("zod").ZodNumber;
1349
- }, import("zod/v4/core").$strip>>;
1350
- previousSizeInBytes: import("zod").ZodNumber;
1351
- currentSizeInBytes: import("zod").ZodNumber;
1352
- }, import("zod/v4/core").$strip>, readonly [{
1353
- readonly reason: "path_forbidden";
1354
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1355
- readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes. (The pre-read also requires the path to be readable.)";
1356
- readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
1357
- }, {
1358
- readonly reason: "regex_invalid";
750
+ readonly reason: "regex_unsafe";
1359
751
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1360
- readonly when: "A `useRegex: true` replacement supplied a `search` pattern that is not a valid ECMAScript regex.";
1361
- readonly recovery: "Use a valid ECMAScript regex, or set useRegex to false to match `search` as a literal string.";
1362
- }, {
1363
- readonly reason: "note_missing";
1364
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1365
- readonly when: "The vault path does not resolve to an existing note.";
1366
- readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
1367
- }, {
1368
- readonly reason: "no_active_file";
1369
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1370
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
1371
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
1372
- }, {
1373
- readonly reason: "periodic_not_found";
1374
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1375
- readonly when: "Target was `periodic` but no matching periodic note exists.";
1376
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
1377
- }, {
1378
- readonly reason: "periodic_disabled";
1379
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1380
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
1381
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
1382
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1383
- mode: import("zod").ZodEnum<{
1384
- text: "text";
1385
- dataview: "dataview";
1386
- jsonlogic: "jsonlogic";
1387
- }>;
1388
- query: import("zod").ZodOptional<import("zod").ZodString>;
1389
- logic: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
1390
- contextLength: import("zod").ZodDefault<import("zod").ZodNumber>;
1391
- pathPrefix: import("zod").ZodOptional<import("zod").ZodString>;
1392
- maxMatchesPerHit: import("zod").ZodDefault<import("zod").ZodNumber>;
1393
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1394
- result: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1395
- mode: import("zod").ZodLiteral<"text">;
1396
- hits: import("zod").ZodArray<import("zod").ZodObject<{
1397
- filename: import("zod").ZodString;
1398
- score: import("zod").ZodOptional<import("zod").ZodNumber>;
1399
- matches: import("zod").ZodArray<import("zod").ZodObject<{
1400
- context: import("zod").ZodString;
1401
- match: import("zod").ZodObject<{
1402
- start: import("zod").ZodNumber;
1403
- end: import("zod").ZodNumber;
1404
- }, import("zod/v4/core").$strip>;
1405
- }, import("zod/v4/core").$strip>>;
1406
- totalMatches: import("zod").ZodOptional<import("zod").ZodNumber>;
1407
- truncated: import("zod").ZodOptional<import("zod").ZodBoolean>;
1408
- }, import("zod/v4/core").$strip>>;
1409
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
1410
- count: import("zod").ZodNumber;
1411
- hint: import("zod").ZodString;
1412
- }, import("zod/v4/core").$strip>>;
1413
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1414
- mode: import("zod").ZodLiteral<"dataview">;
1415
- hits: import("zod").ZodArray<import("zod").ZodObject<{
1416
- filename: import("zod").ZodString;
1417
- result: import("zod").ZodUnknown;
1418
- }, import("zod/v4/core").$strip>>;
1419
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
1420
- count: import("zod").ZodNumber;
1421
- hint: import("zod").ZodString;
1422
- }, import("zod/v4/core").$strip>>;
1423
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1424
- mode: import("zod").ZodLiteral<"jsonlogic">;
1425
- hits: import("zod").ZodArray<import("zod").ZodObject<{
1426
- filename: import("zod").ZodString;
1427
- result: import("zod").ZodUnknown;
1428
- }, import("zod/v4/core").$strip>>;
1429
- excluded: import("zod").ZodOptional<import("zod").ZodObject<{
1430
- count: import("zod").ZodNumber;
1431
- hint: import("zod").ZodString;
1432
- }, import("zod/v4/core").$strip>>;
1433
- }, import("zod/v4/core").$strip>], "mode">;
1434
- }, import("zod/v4/core").$strip>, readonly [{
1435
- readonly reason: "path_prefix_invalid_mode";
1436
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1437
- readonly when: "`pathPrefix` was provided in a non-text mode (only `text` supports prefix filtering).";
1438
- readonly recovery: "Drop pathPrefix or switch mode to text for prefix filtering.";
1439
- }, {
1440
- readonly reason: "query_required";
1441
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1442
- readonly when: "`query` is missing for `text` or `dataview` mode (required for both).";
1443
- readonly recovery: "Pass `query` — search terms for text mode (e.g. \"TODO\"), or DQL like \"TABLE WHERE file.mtime > date(today)\" for dataview mode.";
1444
- }, {
1445
- readonly reason: "logic_required";
1446
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1447
- readonly when: "`logic` is missing for `jsonlogic` mode.";
1448
- readonly recovery: "Pass a JSONLogic tree as `logic`, e.g. `{\"glob\": [{\"var\": \"path\"}, \"Projects/*.md\"]}`.";
1449
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1450
- target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
1451
- type: import("zod").ZodLiteral<"path">;
1452
- path: import("zod").ZodString;
1453
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1454
- type: import("zod").ZodLiteral<"active">;
1455
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1456
- type: import("zod").ZodLiteral<"periodic">;
1457
- period: import("zod").ZodEnum<{
1458
- daily: "daily";
1459
- weekly: "weekly";
1460
- monthly: "monthly";
1461
- quarterly: "quarterly";
1462
- yearly: "yearly";
1463
- }>;
1464
- date: import("zod").ZodOptional<import("zod").ZodString>;
1465
- }, import("zod/v4/core").$strip>], "type">;
1466
- content: import("zod").ZodString;
1467
- section: import("zod").ZodOptional<import("zod").ZodObject<{
1468
- type: import("zod").ZodEnum<{
1469
- heading: "heading";
1470
- block: "block";
1471
- frontmatter: "frontmatter";
1472
- }>;
1473
- target: import("zod").ZodString;
1474
- }, import("zod/v4/core").$strip>>;
1475
- contentType: import("zod").ZodDefault<import("zod").ZodEnum<{
1476
- markdown: "markdown";
1477
- json: "json";
1478
- }>>;
1479
- overwrite: import("zod").ZodDefault<import("zod").ZodBoolean>;
1480
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1481
- path: import("zod").ZodString;
1482
- sectionTargeted: import("zod").ZodBoolean;
1483
- created: import("zod").ZodBoolean;
1484
- previousSizeInBytes: import("zod").ZodNumber;
1485
- currentSizeInBytes: import("zod").ZodNumber;
1486
- }, import("zod/v4/core").$strip>, readonly [{
1487
- readonly reason: "file_exists";
1488
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
1489
- readonly when: "Whole-file write was attempted against an existing note and `overwrite` was not set to `true`.";
1490
- readonly recovery: "Retry with overwrite true or use obsidian_patch_note for in-place edits.";
1491
- }, {
1492
- readonly reason: "path_forbidden";
1493
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
1494
- readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
1495
- readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
1496
- }, {
1497
- readonly reason: "note_missing";
1498
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1499
- readonly when: "Section replace targets a path that does not resolve to an existing note (PATCH requires the file to exist).";
1500
- readonly recovery: "Verify the path with obsidian_list_notes, or omit `section` to fall back to whole-file write (which creates the note when it is absent).";
1501
- }, {
1502
- readonly reason: "no_active_file";
1503
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1504
- readonly when: "Target was `active` but no file is currently open in Obsidian.";
1505
- readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead.";
1506
- }, {
1507
- readonly reason: "periodic_not_found";
1508
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1509
- readonly when: "Target was `periodic` but no matching periodic note exists.";
1510
- readonly recovery: "Create the periodic note first or pass an explicit path target.";
1511
- }, {
1512
- readonly reason: "periodic_disabled";
1513
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1514
- readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
1515
- readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
1516
- }, {
1517
- readonly reason: "section_target_missing";
1518
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
1519
- readonly when: "`section` was provided but the named heading/block/frontmatter field does not exist in the note.";
1520
- readonly recovery: "Call obsidian_get_note with format document-map to discover available targets.";
752
+ readonly when: "The supplied `nameRegex` is well-formed but exceeds the 256-character limit or contains nested quantifiers known to cause catastrophic backtracking.";
753
+ readonly recovery: "Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern (e.g. `^Templater`), or omit nameRegex to disable filtering.";
1521
754
  }]>)[];
1522
- /** Command-palette tools — opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`; suppressed by `OBSIDIAN_READ_ONLY=true`. */
1523
- export declare const commandToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
1524
- commandId: import("zod").ZodString;
1525
- }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1526
- commandId: import("zod").ZodString;
1527
- executed: import("zod").ZodBoolean;
1528
- }, import("zod/v4/core").$strip>, readonly [{
1529
- readonly reason: "command_unknown";
1530
- readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
1531
- readonly when: "The supplied `commandId` is not registered in Obsidian. Use `obsidian_list_commands` to discover valid IDs.";
1532
- readonly recovery: "Call obsidian_list_commands to discover the registered command IDs.";
1533
- }]> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1534
- commands: import("zod").ZodArray<import("zod").ZodObject<{
1535
- id: import("zod").ZodString;
1536
- name: import("zod").ZodString;
1537
- }, import("zod/v4/core").$strip>>;
1538
- }, import("zod/v4/core").$strip>, undefined>)[];
1539
755
  //# sourceMappingURL=index.d.ts.map