/** * @fileoverview obsidian_get_note — read a note's content, full NoteJson, * structural document map, or a single section. * @module mcp-server/tools/definitions/obsidian-get-note.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const obsidianGetNote: import("@cyanheads/mcp-ts-core").ToolDefinition; target: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"path">; path: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"active">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"periodic">; period: z.ZodEnum<{ daily: "daily"; monthly: "monthly"; quarterly: "quarterly"; weekly: "weekly"; yearly: "yearly"; }>; date: z.ZodOptional; }, z.core.$strip>], "type">; section: z.ZodOptional; target: z.ZodString; }, z.core.$strip>>; includeLinks: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ result: z.ZodDiscriminatedUnion<[z.ZodObject<{ format: z.ZodLiteral<"content">; path: z.ZodString; content: z.ZodString; }, z.core.$strip>, z.ZodObject<{ format: z.ZodLiteral<"full">; path: z.ZodString; content: z.ZodString; frontmatter: z.ZodRecord; tags: z.ZodArray; stat: z.ZodObject<{ ctime: z.ZodNumber; mtime: z.ZodNumber; size: z.ZodNumber; }, z.core.$strip>; outgoingLinks: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ format: z.ZodLiteral<"document-map">; path: z.ZodString; headings: z.ZodArray; blocks: z.ZodArray; frontmatterFields: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ format: z.ZodLiteral<"section">; path: z.ZodString; section: z.ZodObject<{ type: z.ZodEnum<{ block: "block"; frontmatter: "frontmatter"; heading: "heading"; }>; target: z.ZodString; }, z.core.$strip>; sectionTarget: z.ZodOptional; candidates: z.ZodOptional>; valueText: z.ZodOptional; valueJson: z.ZodOptional; }, z.core.$strip>], "format">; }, z.core.$strip>, readonly [{ readonly reason: "section_required"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "`format` is \"section\" but no `section` locator was provided."; readonly recovery: "Pass `section: { type, target }` (e.g. `{ type: \"heading\", target: \"Intro\" }`), or use `format: \"full\"` / `\"document-map\"` instead."; }, { readonly reason: "path_forbidden"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Forbidden; readonly when: "The target path is outside OBSIDIAN_READ_PATHS (and OBSIDIAN_WRITE_PATHS, since write paths imply read access), or inside OBSIDIAN_DENY_PATHS."; readonly recovery: "Use a path inside the configured read scope. The error data echoes the active scope; a `denied_path` denial carries none, since the operator withholds that path."; }, { readonly reason: "note_missing"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "The vault path does not resolve to an existing note."; readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note."; }, { readonly reason: "ambiguous_path"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Conflict; readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only)."; readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data."; }, { readonly reason: "no_active_file"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "Target was `active` but no file is currently open in Obsidian."; readonly recovery: "Call obsidian_open_in_ui to focus a file, or pass an explicit path target instead."; }, { readonly reason: "periodic_unsupported"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "Target was `periodic` and this vault runs Local REST API v5.0.2 or later without the companion periodic-notes extension, so the `/periodic/` routes are not served at all."; readonly recovery: "Install the periodic-notes extension from https://github.com/coddingtonbear/obsidian-local-rest-api-periodic-notes, or address the note by an explicit vault path."; }, { readonly reason: "periodic_not_found"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "Target was `periodic`, the `/periodic/` routes are served on this vault, and no note exists for the requested period."; readonly recovery: "Create the periodic note first or pass an explicit path target."; }, { readonly reason: "periodic_disabled"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings."; readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin."; }, { readonly reason: "section_missing"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "`format` was `\"section\"` and the named heading, block reference, or frontmatter field does not exist in the resolved note."; readonly recovery: "Call obsidian_get_note with format \"document-map\" to list available headings, blocks, and frontmatter fields, then retry with one of those locators."; }, { readonly reason: "path_is_directory"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The supplied path names a folder rather than a note file."; readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns."; }, { readonly reason: "path_traversal"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape."; readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault."; }], { readonly requestedPath: z.ZodOptional; readonly notice: z.ZodOptional; }>; //# sourceMappingURL=obsidian-get-note.tool.d.ts.map