read_file
Retrieve content from files in your Obsidian vault to access notes and data for processing or analysis.
Instructions
Read content of a specific file from the vault
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file |
Implementation Reference
- src/index.ts:460-462 (handler)MCP tool call handler for 'read_file' tool: extracts path argument and delegates execution to the ObsidianApiClient.readFile method.case "read_file": result = await this.client.readFile(args?.path as string); break;
- src/index.ts:290-300 (registration)Registration of the 'read_file' tool in the ListTools response, including name, description, and input schema definition.{ 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"], }, },
- src/index.ts:112-114 (helper)Core helper method in ObsidianApiClient that performs the HTTP GET request to retrieve file content from the Obsidian REST API.async readFile(path: string) { return this.request(`/files/${encodeURIComponent(path)}`); }