Skip to main content
Glama
takuya0206

Obsidian MCP

by takuya0206

readNote

Retrieve the contents of a specific note from your Obsidian vault by providing its file path.

Instructions

Read the contents of a specific note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Factory function that creates the readNote tool handler. The returned async function executes the tool logic: reads the note content using ObsidianAPI and returns formatted success or error response.
    export function createReadNoteTool(api: ObsidianAPI): ToolHandler {
      return async (params: { path: string }): Promise<ToolResponse> => {
        try {
          const note = await api.readNote(params.path);
          return formatSuccessResponse(note);
        } catch (error) {
          return formatErrorResponse(`Error reading note: ${(error as Error).message}`);
        }
      };
    }
  • Zod schema for validating input parameters of the readNote tool (requires a non-empty 'path' string).
    export const ReadNoteSchema = {
      path: z.string().min(1, "Note path is required")
    };
  • src/server.ts:47-52 (registration)
    Registration of the readNote tool on the MCP server using server.tool() with name, description, schema, and handler factory.
    this.server.tool(
      readNoteDefinition.name,
      readNoteDefinition.description,
      readNoteDefinition.schema,
      createReadNoteTool(this.api)
    );
  • ObsidianAPI method that performs the HTTP GET request to fetch the note content from the vault, used by the tool handler.
    async readNote(path: string): Promise<NoteJson> {
      const normalizedPath = path.startsWith("/") ? path.substring(1) : path;
    
      const response = await this.client.get(
        `/vault/${encodeURIComponent(normalizedPath)}`,
        {
          headers: {
            ...this.defaultHeaders,
            "Content-Type": "application/json",
            accept: "application/vnd.olrapi.note+json",
          },
        }
      );
      return response.data as NoteJson;
    }
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. While 'Read' implies a read-only operation, it doesn't specify what 'contents' includes (e.g., text, metadata, formatting), error handling (e.g., what happens if the note doesn't exist), or any constraints like rate limits or authentication needs. This leaves significant gaps in understanding the tool's behavior.

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 extremely concise with a single, direct sentence that states the core function without any unnecessary words. It's front-loaded and wastes no space, 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?

Given the lack of annotations, 0% schema description coverage, and no output schema, the description is incomplete. It doesn't address what the tool returns (e.g., note content format), error conditions, or how it differs from siblings like 'readActiveNote'. For a tool with one parameter and no structured documentation, more context is needed to be fully helpful.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate. It mentions 'a specific note' but doesn't explain what the 'path' parameter represents (e.g., file path, note ID, URL format) or provide any examples. This adds minimal value beyond what's inferred from the tool name, failing to adequately document the single required parameter.

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 verb ('Read') and resource ('contents of a specific note'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'readActiveNote' or 'listNotes', which would require specifying what makes this tool distinct from those alternatives.

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 'readActiveNote' or 'listNotes'. It doesn't mention prerequisites, context, or any explicit when/when-not scenarios, leaving the agent to infer usage from the tool name alone.

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/takuya0206/obsidian-mcp'

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