Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

read_file

Access and retrieve the complete contents of a file from an Obsidian vault stored in iCloud Drive. Handles multiple text encodings and provides detailed error messages for troubleshooting. Use this tool to examine specific files within allowed directories.

Instructions

Your task is to read file from /Users/username/Library/Mobile Documents/iCloud~md~obsidian/Documents/my-vault. Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The main handler function for the 'read_file' tool. It parses the input arguments using ReadFileArgsSchema, reads the file content using fs.readFile, and returns the content in the expected format.
    export async function readFile(args?: Record<string, unknown>) { const parsed = ReadFileArgsSchema.safeParse(args) if (!parsed.success) { throw new Error(`Invalid arguments for read_file: ${parsed.error}`) } const content = await fs.readFile(parsed.data.path, 'utf-8') return { content: [{ type: 'text', text: content }] } }
  • Zod schema for validating the input arguments of the 'read_file' tool, which requires a 'path' string.
    export const ReadFileArgsSchema = z.object({ path: z.string() })
  • src/index.ts:171-173 (registration)
    In the CallToolRequestSchema handler, the switch case that routes calls to the 'read_file' tool to the readFile handler function.
    case 'read_file': { return readFile(args) }
  • src/index.ts:101-104 (registration)
    Tool registration in ListToolsRequestSchema response, defining the name, dynamic description from prompt, and input schema for 'read_file'.
    name: 'read_file', description: readFilePrompt(args), inputSchema: zodToJsonSchema(ReadFileArgsSchema) as ToolInput },

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

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