/** * @fileoverview obsidian_list_notes — recursive vault listing with bounded depth. * Walks the vault tree DFS up to `depth` levels (default 2 — top-level + their * immediate children, the structural-overview sweet spot), applying optional * extension and nameRegex filters across the walk, and renders both a flat * `entries[]` array (for programmatic consumption) and a box-drawing tree view * in `format()` (for LLM consumption — tree views are easier to scan than flat * paths). Hard cap at {@link ENTRY_CAP} entries protects against runaway HTTP * fan-out on large vaults; per-directory `truncated: true` flags signal where * the depth limit cut off recursion. Drill deeper by passing a higher `depth`, * narrowing with `path`, or filtering with `extension`/`nameRegex`. * * Under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, `ObsidianService.listFiles` * returns only readable entries and the folders on the way to the scope, and * lists those folders when asked — so the walk descends into everything it is * handed, and the entry cap and totals count returned entries only. * * Named `_notes` rather than `_files` to disambiguate from agents' generic * file-system tools (Read, Glob, LS) — a `_files` tool surface tempts agents * to fish for non-vault paths through it. * @module mcp-server/tools/definitions/obsidian-list-notes.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const obsidianListNotes: import("@cyanheads/mcp-ts-core").ToolDefinition; extension: z.ZodOptional; nameRegex: z.ZodOptional; depth: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ path: z.ZodString; entries: z.ZodArray; truncated: z.ZodOptional; }, z.core.$strip>>; totals: z.ZodObject<{ entries: z.ZodNumber; files: z.ZodNumber; directories: z.ZodNumber; }, z.core.$strip>; appliedFilters: z.ZodObject<{ extension: z.ZodOptional; nameRegex: z.ZodOptional; depth: z.ZodNumber; }, z.core.$strip>; excluded: z.ZodOptional; cap: z.ZodNumber; hint: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>, readonly [{ readonly reason: "regex_invalid"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The supplied `nameRegex` is not a valid ECMAScript regex."; readonly recovery: "Use a valid ECMAScript regex (e.g. `^Project.*\\.md$`), or omit nameRegex to disable filtering."; }, { readonly reason: "regex_unsafe"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The supplied `nameRegex` is well-formed but exceeds the 256-character limit or contains nested quantifiers known to cause catastrophic backtracking."; readonly recovery: "Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern (e.g. `^Project.*\\.md$`), or omit nameRegex to disable filtering."; }, { readonly reason: "path_forbidden"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Forbidden; readonly when: "The supplied `path` is outside OBSIDIAN_READ_PATHS and is not a folder on the way to it, or is inside OBSIDIAN_DENY_PATHS. The vault root and the folders leading to a scoped path always list, showing only in-scope entries."; 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; a `denied_path` denial carries none, since the operator withholds that path."; }, { readonly reason: "directory_missing"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "No listable directory at the supplied `path` — either it does not exist, or it exists and currently holds no files. Sub-directories that disappear mid-walk are silently skipped, so only the root path surfaces this error."; readonly recovery: "List the parent directory to check the spelling and casing. A folder that exists but holds no files reports the same way, since the Local REST API omits empty folders from its listings — add a file to it, or confirm from the parent that the folder is there."; }, { readonly reason: "path_is_file"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The supplied `path` names a file rather than a directory."; readonly recovery: "Read the file with obsidian_get_note instead, or list its parent directory to browse alongside it."; }], { readonly notice: z.ZodOptional; }>; //# sourceMappingURL=obsidian-list-notes.tool.d.ts.map