diff --git a/src/tools/file-operations.ts b/src/tools/file-operations.ts index 9484450..8f9d484 100644 --- a/src/tools/file-operations.ts +++ b/src/tools/file-operations.ts @@ -28,17 +28,18 @@ export async function registerFileOperationTools(server: ObsidianMCPServer): Pro // T029: Create note tool server.registerTool( 'obsidian_create_note', - 'Create a new note in the Obsidian vault. Optionally specify path, content, template, and whether to overwrite existing notes or open after creation.', + 'Create a new note in the Obsidian vault. "name" is the filename only (e.g. "My Note.md"). "path" is the folder only (e.g. "Projects/Work") — do not include the filename in path. When overwrite is true the existing file is replaced.', { type: 'object', + required: ['name'], properties: { name: { type: 'string', - description: 'File name for the new note', + description: 'Filename for the new note (e.g. "My Note.md"). Do not include folder path here.', }, path: { type: 'string', - description: 'Full file path (alternative to name)', + description: 'Folder path where the note will be created (e.g. "Projects/Work"). Do not include the filename here. Omit for vault root.', }, content: { type: 'string', @@ -50,7 +51,7 @@ export async function registerFileOperationTools(server: ObsidianMCPServer): Pro }, overwrite: { type: 'boolean', - description: 'Overwrite if file exists (optional)', + description: 'Replace the file if it already exists (optional)', }, open: { type: 'boolean', @@ -66,14 +67,15 @@ export async function registerFileOperationTools(server: ObsidianMCPServer): Pro 'Create a new note in the Obsidian vault', { type: 'object', + required: ['name'], properties: { name: { type: 'string', - description: 'File name for the new note', + description: 'Filename for the new note (e.g. "My Note.md"). Do not include folder path here.', }, path: { type: 'string', - description: 'Full file path (alternative to name)', + description: 'Folder path where the note will be created (e.g. "Projects/Work"). Do not include the filename here. Omit for vault root.', }, content: { type: 'string', @@ -85,7 +87,7 @@ export async function registerFileOperationTools(server: ObsidianMCPServer): Pro }, overwrite: { type: 'boolean', - description: 'Overwrite if file exists (optional)', + description: 'Replace the file if it already exists (optional)', }, open: { type: 'boolean', @@ -102,8 +104,6 @@ export async function registerFileOperationTools(server: ObsidianMCPServer): Pro const sanitized = sanitizeParameters(validated) as any; const cmdArgs: string[] = []; - - // Add name or path parameter if (sanitized.name) cmdArgs.push(formatParam('name', sanitized.name as string)); if (sanitized.path) cmdArgs.push(formatParam('path', sanitized.path as string)); if (sanitized.content) cmdArgs.push(formatParam('content', sanitized.content as string));