update_note
Modify existing note content in Obsidian vaults by specifying the file path and new text, enabling content updates and revisions.
Instructions
Obsidianノートの内容を更新します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notePath | Yes | ノートのパス(vault相対パス) | |
| content | Yes | 新しいノートの内容 |
Implementation Reference
- src/obsidian-handler.ts:74-82 (handler)Core handler function that validates the note path and writes the new content to the Obsidian vault file.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:105-117 (schema)Input schema defining parameters: notePath (string, vault-relative path) and content (string).inputSchema: { type: 'object', properties: { notePath: { type: 'string', description: 'ノートのパス(vault相対パス)', }, content: { type: 'string', description: '新しいノートの内容', }, }, required: ['notePath', 'content'],
- src/server.ts:102-119 (registration)Tool registration in the listTools response, including 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 handler in the CallToolRequest 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 }], };