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.'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/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 reveals key behaviors: simultaneous reading, return format (content plus path), partial failure handling ('Failed reads for individual files won't stop the entire operation'), and path restrictions ('Only works within allowed directories'). This goes well beyond the minimal and covers critical behavioral traits.

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?

The description is four sentences with no wasted words. It front-loads the core purpose, then efficiently adds efficiency rationale, return format, failure behavior, and permission scope. Every sentence earns its place.

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

Completeness5/5

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

Given the tool has only one parameter, no annotations, and no output schema, the description is remarkably complete. It covers return format, failure handling, scope restrictions, and the comparative advantage over single-file reads. It leaves little ambiguity for an agent deciding when and how to invoke this tool.

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?

The schema has one parameter 'paths' with zero description coverage. The description compensates by explaining the purpose of paths indirectly ('Each file's content is returned with its path as a reference') and adds a constraint ('Only works within allowed directories'). It clarifies the parameter's role, though it does not specify path format (e.g., absolute vs relative).

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 tool reads multiple files simultaneously, using a specific verb and resource. It distinguishes itself from the sibling 'read_file' by noting it is 'more efficient than reading files one by one', which clarifies its unique purpose.

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 provides clear usage context: 'when you need to analyze or compare multiple files'. It implies the alternative of reading files individually, but does not explicitly name 'read_file' as an alternative or specify when not to use this tool. This is clear guidance but lacks explicit exclusions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools

Related Tools