/** * @fileoverview obsidian_manage_frontmatter — atomic get/set/delete on a single * frontmatter key. `set` PATCHes the field; `delete` reads-modifies-writes the * file because PATCH has no `delete` operation. * @module mcp-server/tools/definitions/obsidian-manage-frontmatter.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const obsidianManageFrontmatter: 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">; key: z.ZodString; value: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ result: z.ZodDiscriminatedUnion<[z.ZodObject<{ operation: z.ZodLiteral<"get">; path: z.ZodString; key: z.ZodString; exists: z.ZodBoolean; value: z.ZodUnknown; }, z.core.$strip>, z.ZodObject<{ operation: z.ZodLiteral<"set">; path: z.ZodString; key: z.ZodString; frontmatter: z.ZodRecord; previousSizeInBytes: z.ZodNumber; currentSizeInBytes: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ operation: z.ZodLiteral<"delete">; path: z.ZodString; key: z.ZodString; frontmatter: z.ZodRecord; previousSizeInBytes: z.ZodNumber; currentSizeInBytes: z.ZodNumber; }, z.core.$strip>], "operation">; }, z.core.$strip>, readonly [{ readonly reason: "path_forbidden"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Forbidden; readonly when: "`get` requires the path to be readable; `set`/`delete` require it to be inside OBSIDIAN_WRITE_PATHS, with OBSIDIAN_READ_ONLY=false. A path inside OBSIDIAN_DENY_PATHS is neither."; readonly recovery: "Use a path inside the configured scope. The error data echoes the active scope; a `denied_path` denial carries none, since the operator withholds that path."; }, { readonly reason: "value_required"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "`operation` is \"set\" but no `value` was supplied."; readonly recovery: "Pass `value` as any JSON-typed value: string, number, boolean, array, or object (e.g. `\"draft\"`, `42`, `true`, `[\"a\",\"b\"]`)."; }, { readonly reason: "frontmatter_invalid"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "`operation` is \"delete\" and the note's existing frontmatter does not parse as a mapping of properties, or removing the key would leave YAML that cannot be re-emitted (an alias whose anchor went with it). Nothing is written — the note keeps its original bytes."; readonly recovery: "Read the block with obsidian_get_note (format \"content\"), repair the YAML between the `---` fences, then retry the delete."; }, { 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: "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: "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."; }], undefined>; //# sourceMappingURL=obsidian-manage-frontmatter.tool.d.ts.map