Skip to main content
Glama
j-shelfwood

Obsidian Local REST API MCP Server

by j-shelfwood

read_file

Retrieve the content of a specific file from an Obsidian vault using its path, enabling direct access to notes and data through a structured API.

Instructions

Read content of a specific file from the vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file

Implementation Reference

  • The core handler function in ObsidianApiClient that executes the tool logic by making a GET request to the Obsidian REST API `/files/{path}` endpoint to read the file content.
    async readFile(path: string) { return this.request(`/files/${encodeURIComponent(path)}`); }
  • src/index.ts:290-300 (registration)
    Registration of the "read_file" MCP tool, including its name, description, and input schema definition in the tools list for ListToolsRequestHandler.
    { name: "read_file", description: "Read content of a specific file from the vault", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the file" }, }, required: ["path"], }, },
  • Input schema definition for the "read_file" tool, specifying the required 'path' parameter as a string.
    inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the file" }, }, required: ["path"], },
  • Tool dispatch handler in the CallToolRequestSchema switch statement that invokes the readFile method for "read_file" tool calls.
    case "read_file": result = await this.client.readFile(args?.path as string); break;

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/j-shelfwood/obsidian-local-rest-api-mcp'

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