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
    },
Behavior3/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. It mentions handling 'various text encodings' and 'detailed error messages', which adds useful context beyond basic functionality. However, it lacks details on permissions, rate limits, or specific error types, leaving gaps for a mutation-free but security-sensitive operation.

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?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. Each sentence adds value: the first states the task, the second elaborates on functionality, and the third provides usage constraints. It could be slightly more concise by merging some clauses, but overall it's efficient with minimal waste.

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?

Given the tool's moderate complexity (file I/O with encoding handling), no annotations, no output schema, and low schema coverage, the description is partially complete. It covers purpose, usage, and some behavioral traits but lacks details on return format, error specifics, or security implications, making it adequate but with clear gaps for safe operation.

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?

The input schema has 0% description coverage for its single parameter 'path', and the tool description doesn't explicitly mention or explain this parameter. However, the description implies the parameter through context ('read file from...'), and with only one parameter, the baseline is 3 as the schema minimally defines it without additional semantic value from the description.

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 specific action ('read file', 'read the complete contents') and resource ('from the file system', 'from /Users/username/Library/Mobile Documents/iCloud~md~obsidian/Documents/my-vault'), distinguishing it from siblings like edit_file, write_file, or read_multiple_files by focusing on single-file examination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states 'Use this tool when you need to examine the contents of a single file' and 'Only works within allowed directories', providing clear context for when to use it. However, it doesn't specify when to use alternatives like read_multiple_files or list_directory, which would require explicit sibling differentiation for a higher score.

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

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