Skip to main content
Glama

read_note

Retrieve and read the content of specific notes within an Obsidian vault using the MCP server. Input a note path to access its entire text for integration or analysis.

Instructions

Read the content of a note in the Obsidian vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the note within the vault

Implementation Reference

  • Core handler implementation for reading note content: attempts Obsidian Local REST API GET /vault/{path}, falls back to direct filesystem fs.readFileSync if API fails or file not found.
    private async readNote(notePath: string): Promise<string> { try { // First try using the Obsidian API const response = await this.api.get(`/vault/${encodeURIComponent(notePath)}`); // API returns the content directly, not wrapped in {content: ...} return response.data || ''; } catch (error) { console.warn('API request failed, falling back to file system:', error); // Fallback to file system if API fails const fullPath = path.join(VAULT_PATH, notePath); if (fs.existsSync(fullPath)) { return fs.readFileSync(fullPath, 'utf-8'); } else { return ''; } } }
  • Direct tool handler for 'read_note': validates path argument, calls core readNote, wraps response in MCP content format.
    private async handleReadNote(args: any) { if (!args?.path) { throw new Error('Path is required'); } const content = await this.readNote(args.path); return { content: [ { type: 'text', text: content, }, ], }; }
  • Input schema definition for read_note tool: requires 'path' string parameter.
    name: 'read_note', description: 'Read the content of a note in the Obsidian vault', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the note within the vault', }, }, required: ['path'], }, },
  • src/index.ts:1391-1391 (registration)
    Tool registration in CallToolRequestSchema handler switch statement: dispatches to handleReadNote.
    return await this.handleReadNote(request.params.arguments);

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/newtype-01/obsidian-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server