Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

read_multiple_files

Read and analyze multiple files simultaneously within Obsidian iCloud MCP, returning each file's content with its path. Designed for efficient file comparison and analysis, it handles failed reads for individual files without stopping the operation.

Instructions

Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYes

Implementation Reference

  • The handler function for 'read_multiple_files' tool. Parses input arguments using the schema, reads contents of multiple files asynchronously, formats each with path and content, joins them with '---' separator, and returns as a single text content block.
    export async function readMultipleFiles(args?: Record<string, unknown>) {
      const parsed = ReadMultipleFilesArgsSchema.safeParse(args)
      if (!parsed.success) {
        throw new Error(
          `Invalid arguments for read_multiple_files: ${parsed.error}`
        )
      }
    
      const results = await Promise.all(
        parsed.data.paths.map(async (filePath: string) => {
          const content = await fs.readFile(filePath, 'utf-8')
          return `${filePath}:\n${content}\n`
        })
      )
      return {
        content: [{ type: 'text', text: results.join('\n---\n') }]
      }
    }
  • Zod schema defining input for read_multiple_files: an object with 'paths' array of strings.
    export const ReadMultipleFilesArgsSchema = z.object({
      paths: z.array(z.string())
    })
  • src/index.ts:106-108 (registration)
    Registration of the 'read_multiple_files' tool in the ListToolsRequestHandler, specifying name, description from prompt, and input schema converted to JSON schema.
    name: 'read_multiple_files',
    description: readMultipleFilesPrompt(),
    inputSchema: zodToJsonSchema(ReadMultipleFilesArgsSchema) as ToolInput
  • src/index.ts:175-177 (registration)
    Dispatch in CallToolRequestHandler switch statement that invokes the readMultipleFiles handler when the tool name matches.
    case 'read_multiple_files': {
      return readMultipleFiles(args)
    }
  • Prompt string used as the tool description, explaining the purpose and usage of read_multiple_files.
    export const readMultipleFilesPrompt = () =>
      'Read the contents of multiple files simultaneously. This is more ' +
      'efficient than reading files one by one when you need to analyze ' +
      "or compare multiple files. Each file's content is returned with its " +
      "path as a reference. Failed reads for individual files won't stop " +
      'the entire operation. Only works within allowed directories.'
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well: it discloses that failed reads for individual files won't stop the entire operation (partial failure behavior), mentions efficiency benefits, and specifies access restrictions ('Only works within allowed directories'). It doesn't cover rate limits or detailed error handling.

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?

Four sentences, each earning its place: states purpose, explains efficiency benefit, describes output format, and specifies access restriction. Front-loaded with core functionality, zero wasted words, appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 1 parameter with 0% schema coverage, the description provides good coverage: purpose, usage context, behavioral traits, and parameter meaning. It lacks details on output format structure, error types, or directory allowance specifics, but is largely complete for a read operation.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explains that 'paths' parameter should contain multiple file paths and that each file's content is returned with its path as reference. This adds meaningful context beyond the bare schema, though it doesn't detail path format or constraints.

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 the contents of multiple files simultaneously'), distinguishes it from the sibling 'read_file' tool by emphasizing batch efficiency, and explains the resource scope ('Only works within allowed directories'). It provides verb+resource+differentiation.

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 when to use this tool ('more efficient than reading files one by one when you need to analyze or compare multiple files'), but does not specify when NOT to use it or name alternatives. It provides clear context for usage without exclusions.

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