Skip to main content
Glama
nojiritakeshi

Obsidian Translation MCP Server

read_obsidian_note

Retrieve the full content of any Obsidian note by specifying its relative path, enabling translation or processing of the note's text.

Instructions

Read content of an existing Obsidian note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the note (relative to vault root)

Implementation Reference

  • src/index.ts:91-99 (registration)
    Tool registration in ListToolsRequestHandler - includes getReadNoteToolDefinition()
      tools: [
        TranslateTool.getToolDefinition(),
        NotesTool.getCreateNoteToolDefinition(),
        NotesTool.getReadNoteToolDefinition(),
        NotesTool.getUpdateNoteToolDefinition(),
        SearchTool.getSearchToolDefinition(),
        SearchTool.getSearchByTagsToolDefinition(),
      ],
    };
  • Handler that validates path, delegates to notesTool.readNote(), and formats the response with frontmatter and content
    private async handleReadNote(args: any) {
      const { path } = args;
      
      if (!path) {
        throw new McpError(ErrorCode.InvalidParams, 'Path is required');
      }
    
      const result = await this.notesTool.readNote(path);
    
      return {
        content: [
          {
            type: 'text',
            text: `๐Ÿ“– ใƒŽใƒผใƒˆใฎๅ†…ๅฎน:\\n\\n` +
                  `๐Ÿ“ ใƒ‘ใ‚น: ${path}\\n` +
                  `๐Ÿ“ ใƒกใ‚ฟใƒ‡ใƒผใ‚ฟ: ${JSON.stringify(result.frontmatter, null, 2)}\\n\\n` +
                  `๐Ÿ“„ ใ‚ณใƒณใƒ†ใƒณใƒ„:\\n${result.content}`
          }
        ]
      };
    }
  • Tool schema definition - input requires 'path' (string) to locate the note relative to vault root
    static getReadNoteToolDefinition(): Tool {
      return {
        name: 'read_obsidian_note',
        description: 'Read content of an existing Obsidian note',
        inputSchema: {
          type: 'object',
          properties: {
            path: {
              type: 'string',
              description: 'Path to the note (relative to vault root)'
            }
          },
          required: ['path']
        }
      };
    }
  • Core business logic: reads file via FileSystemHelper, parses frontmatter with gray-matter, returns content and frontmatter
    async readNote(path: string): Promise<{ content: string; frontmatter: any }> {
      try {
        const rawContent = await this.fileSystem.readFile(path);
        const { data: frontmatter, content } = matter(rawContent);
    
        return {
          content,
          frontmatter
        };
      } catch (error) {
        if (error instanceof Error) {
          throw error;
        }
        throw new Error(`${ErrorCode.FILE_NOT_FOUND}: Failed to read note '${path}'`);
      }
    }
  • Utility that resolves relative path to absolute vault path and reads file content with fs.readFile
    async readFile(filePath: string): Promise<string> {
      try {
        const absolutePath = this.getAbsolutePath(filePath);
        return await fs.readFile(absolutePath, 'utf-8');
      } catch (error) {
        throw new Error(`${ErrorCode.FILE_NOT_FOUND}: Cannot read file '${filePath}': ${error}`);
      }
    }
Behavior2/5

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

No annotations provided, so description carries full burden. Description only says 'read' but does not disclose whether it returns raw markdown, file metadata, or any limitations (e.g., file size, encoding). The behavioral traits are underspecified.

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

Conciseness4/5

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

Single sentence with no redundancy. For a simple read tool, this is appropriately concise. However, it could be slightly expanded to include return format without losing conciseness.

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

Completeness3/5

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

With no output schema, the description should clarify what the tool returns (e.g., 'Returns the full content as a string'). The current description is minimal but insufficient for a complete understanding of the tool's behavior.

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?

Schema coverage is 100% for the only parameter 'path'. The description adds no semantic information beyond what the schema already provides (path relative to vault root). Baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool reads content of an existing Obsidian note, which is a specific verb+resource combination. It distinguishes itself from sibling tools like create, search, update, translate, and search by tags.

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?

No guidance on when to use this tool versus alternatives. For example, it does not clarify that this tool is for retrieving content and not for searching or modifying notes. The agent must infer usage from the name.

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/nojiritakeshi/obsidian-translate-mcp-server'

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