update_note
Modify existing notes in your Obsidian vault by specifying the file path and new content to update.
Instructions
Obsidianノートの内容を更新します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notePath | Yes | ノートのパス(vault相対パス) | |
| content | Yes | 新しいノートの内容 |
Implementation Reference
- src/obsidian-handler.ts:74-82 (handler)The core handler function in ObsidianHandler class that validates the note path and writes the new content to the file in the Obsidian vault.async updateNote(notePath: string, content: string): Promise<string> { if (!FileUtils.validatePath(this.config.vaultPath, notePath)) { throw new Error('無効なファイルパスです'); } const fullPath = path.join(this.config.vaultPath, notePath); await fs.writeFile(fullPath, content, 'utf-8'); return `ノート '${notePath}' を更新しました`;
- src/server.ts:102-119 (registration)MCP tool registration in the server's listTools handler, defining the tool name, description, and input schema.{ name: 'update_note', description: 'Obsidianノートの内容を更新します', inputSchema: { type: 'object', properties: { notePath: { type: 'string', description: 'ノートのパス(vault相対パス)', }, content: { type: 'string', description: '新しいノートの内容', }, }, required: ['notePath', 'content'], }, },
- src/server.ts:287-294 (handler)Dispatch logic in the MCP callTool request handler that extracts arguments and calls the ObsidianHandler.updateNote method.case 'update_note': const updateResult = await this.obsidianHandler.updateNote( args.notePath as string, args.content as string ); return { content: [{ type: 'text', text: updateResult }], };