obsidian-mcp-server
Version:
MCP server for Obsidian vaults — read, write, search, and surgically edit notes, tags, and frontmatter via the Local REST API plugin. STDIO or Streamable HTTP.
62 lines • 3.06 kB
TypeScript
/**
* @fileoverview obsidian_delete_note — permanently delete a note. Calls
* `ctx.elicit` to confirm with the user when the client supports it; falls
* back to the destructive-hint annotation otherwise.
* @module mcp-server/tools/definitions/obsidian-delete-note.tool
*/
import { z } from '@cyanheads/mcp-ts-core';
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
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";
weekly: "weekly";
monthly: "monthly";
quarterly: "quarterly";
yearly: "yearly";
}>;
date: z.ZodOptional<z.ZodString>;
}, z.core.$strip>], "type">;
}, z.core.$strip>, z.ZodObject<{
path: z.ZodString;
deleted: z.ZodBoolean;
previousSizeInBytes: z.ZodNumber;
currentSizeInBytes: z.ZodNumber;
}, z.core.$strip>, readonly [{
readonly reason: "path_forbidden";
readonly code: JsonRpcErrorCode.Forbidden;
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
}, {
readonly reason: "cancelled";
readonly code: JsonRpcErrorCode.InvalidRequest;
readonly when: "User declined the deletion via interactive elicitation.";
readonly recovery: "Re-run the tool when the user is ready to confirm deletion.";
}, {
readonly reason: "note_missing";
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 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_not_found";
readonly code: JsonRpcErrorCode.NotFound;
readonly when: "Target was `periodic` but no matching periodic note exists.";
readonly recovery: "Pass an explicit path target — periodic notes must already exist.";
}, {
readonly reason: "periodic_disabled";
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.";
}], undefined>;
//# sourceMappingURL=obsidian-delete-note.tool.d.ts.map