Skip to main content
Glama

read_note

Retrieve note content from your Obsidian vault by specifying the file path, enabling AI models to access and reference stored knowledge.

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

  • MCP tool handler for 'read_note' that validates the input path, reads the note content using the private readNote method, and returns it in the 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,
          },
        ],
      };
    }
  • Core implementation of note reading logic: attempts to fetch content via Obsidian Local REST API GET /vault/{path}, with fallback 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 '';
        }
      }
  • JSON schema definition for the read_note tool input, defining the required 'path' string parameter. This is returned by the ListToolsRequestHandler.
      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)
    Dispatch/registration case in the CallToolRequestSchema handler that routes 'read_note' tool calls to the handleReadNote method.
    return await this.handleReadNote(request.params.arguments);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation, which implies safety, but doesn't cover important aspects like error handling (e.g., what happens if the path is invalid), return format, or performance considerations (e.g., file size limits).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the key action and resource, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns (e.g., note content, metadata), error conditions, or how it interacts with the vault structure, leaving significant gaps for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the 'path' parameter fully documented in the schema. The description doesn't add any additional semantic context beyond what the schema provides, such as path format examples or vault structure details, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Read') and resource ('content of a note in the Obsidian vault'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'read_multiple_notes' or 'list_notes', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'read_multiple_otes' or 'list_notes'. It also lacks information about prerequisites, such as whether the note must exist or if there are access restrictions, leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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